summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorAlexis LACROIX <alexis.lacroix@orange.com>2017-02-22 15:03:33 +0100
committerLauri Ojansivu <x@xet7.org>2017-02-22 17:05:30 +0200
commit6ca832c02b2fa87720005f277b3fcb21dcf5ae6f (patch)
tree46083001472636f51ea2806bb0afb26afe1f852a /models
parentcd6317cedbd9815284d4e533f00fbc75c8e06afc (diff)
downloadwekan-6ca832c02b2fa87720005f277b3fcb21dcf5ae6f.tar.gz
wekan-6ca832c02b2fa87720005f277b3fcb21dcf5ae6f.tar.bz2
wekan-6ca832c02b2fa87720005f277b3fcb21dcf5ae6f.zip
Improve wekan performance (checklist collection scan)
Diffstat (limited to 'models')
-rw-r--r--models/boards.js4
-rw-r--r--models/checklists.js4
2 files changed, 5 insertions, 3 deletions
diff --git a/models/boards.js b/models/boards.js
index 0f66e9d6..9323d690 100644
--- a/models/boards.js
+++ b/models/boards.js
@@ -414,9 +414,7 @@ if (Meteor.isServer) {
_id: 1,
'members.userId': 1,
}, { unique: true });
- Boards._collection._ensureIndex({
- 'members.userId': 1,
- }, { unique: true });
+ Boards._collection._ensureIndex({'members.userId': 1});
});
// Genesis: the first activity of the newly created board
diff --git a/models/checklists.js b/models/checklists.js
index 35be4dcc..3425f230 100644
--- a/models/checklists.js
+++ b/models/checklists.js
@@ -133,6 +133,10 @@ Checklists.mutations({
});
if (Meteor.isServer) {
+ Meteor.startup(() => {
+ Checklists._collection._ensureIndex({ cardId: 1, createdAt: 1 });
+ });
+
Checklists.after.insert((userId, doc) => {
Activities.insert({
userId,