File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change
1
+ import * as _ from 'lodash' ;
2
+
3
+ import { MongoCollections } from '../src/mongo' ;
4
+ import { IStreamModel } from '../src/models/stream' ;
5
+ import { ISubscriberModel } from '../src/models/subscriber' ;
6
+
7
+ export async function up ( ) : Promise < void > {
8
+ const streamsCollection =
9
+ MongoCollections . getCollection < IStreamModel > ( 'streams' ) ;
10
+ const subscribersCollection =
11
+ MongoCollections . getCollection < ISubscriberModel > ( 'subscribers' ) ;
12
+
13
+ await streamsCollection . createIndex (
14
+ {
15
+ server : 1 ,
16
+ app : 1 ,
17
+ channel : 1 ,
18
+ connectId : 1 ,
19
+ connectCreated : 1 ,
20
+ } ,
21
+ { unique : true } ,
22
+ ) ;
23
+
24
+ await subscribersCollection . createIndex (
25
+ {
26
+ server : 1 ,
27
+ app : 1 ,
28
+ channel : 1 ,
29
+ connectId : 1 ,
30
+ connectCreated : 1 ,
31
+ } ,
32
+ { unique : true } ,
33
+ ) ;
34
+ }
You can’t perform that action at this time.
0 commit comments