diff options
author | Lauri Ojansivu <x@xet7.org> | 2019-02-28 23:03:16 +0200 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2019-02-28 23:03:16 +0200 |
commit | 174ad1a9877fd0b7523f9a9b074352e5268ffaf7 (patch) | |
tree | 07cce2399e7699567468987a73c1f2258a95108e /models | |
parent | 199246ea6caac1cfcfe64d082ce887b3bccb1ee3 (diff) | |
parent | 49882a05d1d1e5cacc950daa282bd6f6ea0d402f (diff) | |
download | wekan-174ad1a9877fd0b7523f9a9b074352e5268ffaf7.tar.gz wekan-174ad1a9877fd0b7523f9a9b074352e5268ffaf7.tar.bz2 wekan-174ad1a9877fd0b7523f9a9b074352e5268ffaf7.zip |
Merge branch 'edge' into meteor-1.8
Diffstat (limited to 'models')
-rw-r--r-- | models/attachments.js | 4 | ||||
-rw-r--r-- | models/checklistItems.js | 1 | ||||
-rw-r--r-- | models/customFields.js | 6 | ||||
-rw-r--r-- | models/integrations.js | 4 | ||||
-rw-r--r-- | models/swimlanes.js | 10 |
5 files changed, 17 insertions, 8 deletions
diff --git a/models/attachments.js b/models/attachments.js index 3da067de..f870861b 100644 --- a/models/attachments.js +++ b/models/attachments.js @@ -27,6 +27,10 @@ Attachments = new FS.Collection('attachments', { if (Meteor.isServer) { + Meteor.startup(() => { + Attachments.files._ensureIndex({ cardId: 1 }); + }); + Attachments.allow({ insert(userId, doc) { return allowIsBoardMember(userId, Boards.findOne(doc.boardId)); diff --git a/models/checklistItems.js b/models/checklistItems.js index 35b18ed7..30e57aec 100644 --- a/models/checklistItems.js +++ b/models/checklistItems.js @@ -189,6 +189,7 @@ function publishChekListUncompleted(userId, doc){ if (Meteor.isServer) { Meteor.startup(() => { ChecklistItems._collection._ensureIndex({ checklistId: 1 }); + ChecklistItems._collection._ensureIndex({ cardId: 1 }); }); ChecklistItems.after.update((userId, doc, fieldNames) => { diff --git a/models/customFields.js b/models/customFields.js index 3e8aa250..b7ad5467 100644 --- a/models/customFields.js +++ b/models/customFields.js @@ -98,9 +98,9 @@ function customFieldCreation(userId, doc){ } if (Meteor.isServer) { - /*Meteor.startup(() => { - CustomFields._collection._ensureIndex({ boardId: 1}); - });*/ + Meteor.startup(() => { + CustomFields._collection._ensureIndex({ boardId: 1 }); + }); CustomFields.after.insert((userId, doc) => { customFieldCreation(userId, doc); diff --git a/models/integrations.js b/models/integrations.js index 1c473b57..65a7af63 100644 --- a/models/integrations.js +++ b/models/integrations.js @@ -88,6 +88,10 @@ Integrations.allow({ //INTEGRATIONS REST API if (Meteor.isServer) { + Meteor.startup(() => { + Integrations._collection._ensureIndex({ boardId: 1 }); + }); + /** * @operation get_all_integrations * @summary Get all integrations in board diff --git a/models/swimlanes.js b/models/swimlanes.js index 1b18ba5d..9da4afb5 100644 --- a/models/swimlanes.js +++ b/models/swimlanes.js @@ -133,14 +133,14 @@ Swimlanes.helpers({ }, lists() { - return Lists.find(Filter.mongoSelector({ + return Lists.find({ boardId: this.boardId, swimlaneId: {$in: [this._id, '']}, archived: false, - }), { sort: ['sort'] }); + }, { sort: ['sort'] }); }, - allLists() { + myLists() { return Lists.find({ swimlaneId: this._id }); }, @@ -189,7 +189,7 @@ Swimlanes.mutations({ archive() { if (this.isTemplateSwimlane()) { - this.lists().forEach((list) => { + this.myLists().forEach((list) => { return list.archive(); }); } @@ -198,7 +198,7 @@ Swimlanes.mutations({ restore() { if (this.isTemplateSwimlane()) { - this.allLists().forEach((list) => { + this.myLists().forEach((list) => { return list.restore(); }); } |