summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--models/activities.js2
-rw-r--r--models/boards.js3
-rw-r--r--models/cards.js2
-rw-r--r--models/unsavedEdits.js3
4 files changed, 9 insertions, 1 deletions
diff --git a/models/activities.js b/models/activities.js
index 7d262ec6..9a41d4aa 100644
--- a/models/activities.js
+++ b/models/activities.js
@@ -52,6 +52,8 @@ if (Meteor.isServer) {
Activities._collection._ensureIndex({ createdAt: -1 });
Activities._collection._ensureIndex({ cardId: 1, createdAt: -1 });
Activities._collection._ensureIndex({ boardId: 1, createdAt: -1 });
+ Activities._collection._ensureIndex({ commentId: 1 }, { partialFilterExpression: { commentId: { $exists: true } } });
+ Activities._collection._ensureIndex({ attachmentId: 1 }, { partialFilterExpression: { attachmentId: { $exists: true } } });
});
Activities.after.insert((userId, doc) => {
diff --git a/models/boards.js b/models/boards.js
index 14943d61..0f66e9d6 100644
--- a/models/boards.js
+++ b/models/boards.js
@@ -414,6 +414,9 @@ if (Meteor.isServer) {
_id: 1,
'members.userId': 1,
}, { unique: true });
+ Boards._collection._ensureIndex({
+ 'members.userId': 1,
+ }, { unique: true });
});
// Genesis: the first activity of the newly created board
diff --git a/models/cards.js b/models/cards.js
index ab735ad0..9c149e51 100644
--- a/models/cards.js
+++ b/models/cards.js
@@ -267,7 +267,7 @@ if (Meteor.isServer) {
// Cards are often fetched within a board, so we create an index to make these
// queries more efficient.
Meteor.startup(() => {
- Cards._collection._ensureIndex({ boardId: 1 });
+ Cards._collection._ensureIndex({ boardId: 1, createdAt: -1 });
});
Cards.after.insert((userId, doc) => {
diff --git a/models/unsavedEdits.js b/models/unsavedEdits.js
index 25952fb5..d4f3616a 100644
--- a/models/unsavedEdits.js
+++ b/models/unsavedEdits.js
@@ -26,6 +26,9 @@ if (Meteor.isServer) {
function isAuthor(userId, doc, fieldNames = []) {
return userId === doc.userId && fieldNames.indexOf('userId') === -1;
}
+ Meteor.startup(() => {
+ UnsavedEditCollection._collection._ensureIndex({ userId: 1 });
+ });
UnsavedEditCollection.allow({
insert: isAuthor,
update: isAuthor,