Skip to content

Commit a034b4a

Browse files
authored
Merge pull request #6 from mythio/master
fix keystore indexing and add travis ci
2 parents 181934c + 4143232 commit a034b4a

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

.travis.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
language: node_js
2+
node_js:
3+
- 13
4+
services:
5+
- docker
6+
before_install:
7+
- cp .env.example .env
8+
- cp keys/public.pem.example keys/public.pem
9+
- cp keys/private.pem.example keys/private.pem
10+
- cp tests/.env.test.example tests/.env.test
11+
- docker-compose up -d

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/database/model/Keystore.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,15 @@ const schema = new Schema(
1818
client: {
1919
type: Schema.Types.ObjectId,
2020
required: true,
21-
ref: 'User',
22-
index: true
21+
ref: 'User'
2322
},
2423
primaryKey: {
2524
type: Schema.Types.String,
26-
required: true,
27-
index: true
25+
required: true
2826
},
2927
secondaryKey: {
3028
type: Schema.Types.String,
31-
required: true,
32-
index: true
29+
required: true
3330
},
3431
status: {
3532
type: Schema.Types.Boolean,
@@ -50,4 +47,7 @@ const schema = new Schema(
5047
versionKey: false
5148
});
5249

50+
schema.index({ client: 1, primaryKey: 1 });
51+
schema.index({ client: 1, primaryKey: 1, secondaryKey: 1 });
52+
5353
export const KeystoreModel = model<Keystore>(DOCUMENT_NAME, schema, COLLECTION_NAME);

0 commit comments

Comments
 (0)