mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30:13 +01:00
Improve wekan performance #837
This commit is contained in:
parent
cd70076af2
commit
cd6317cedb
4 changed files with 9 additions and 1 deletions
|
|
@ -52,6 +52,8 @@ if (Meteor.isServer) {
|
||||||
Activities._collection._ensureIndex({ createdAt: -1 });
|
Activities._collection._ensureIndex({ createdAt: -1 });
|
||||||
Activities._collection._ensureIndex({ cardId: 1, createdAt: -1 });
|
Activities._collection._ensureIndex({ cardId: 1, createdAt: -1 });
|
||||||
Activities._collection._ensureIndex({ boardId: 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) => {
|
Activities.after.insert((userId, doc) => {
|
||||||
|
|
|
||||||
|
|
@ -414,6 +414,9 @@ if (Meteor.isServer) {
|
||||||
_id: 1,
|
_id: 1,
|
||||||
'members.userId': 1,
|
'members.userId': 1,
|
||||||
}, { unique: true });
|
}, { unique: true });
|
||||||
|
Boards._collection._ensureIndex({
|
||||||
|
'members.userId': 1,
|
||||||
|
}, { unique: true });
|
||||||
});
|
});
|
||||||
|
|
||||||
// Genesis: the first activity of the newly created board
|
// Genesis: the first activity of the newly created board
|
||||||
|
|
|
||||||
|
|
@ -267,7 +267,7 @@ if (Meteor.isServer) {
|
||||||
// Cards are often fetched within a board, so we create an index to make these
|
// Cards are often fetched within a board, so we create an index to make these
|
||||||
// queries more efficient.
|
// queries more efficient.
|
||||||
Meteor.startup(() => {
|
Meteor.startup(() => {
|
||||||
Cards._collection._ensureIndex({ boardId: 1 });
|
Cards._collection._ensureIndex({ boardId: 1, createdAt: -1 });
|
||||||
});
|
});
|
||||||
|
|
||||||
Cards.after.insert((userId, doc) => {
|
Cards.after.insert((userId, doc) => {
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,9 @@ if (Meteor.isServer) {
|
||||||
function isAuthor(userId, doc, fieldNames = []) {
|
function isAuthor(userId, doc, fieldNames = []) {
|
||||||
return userId === doc.userId && fieldNames.indexOf('userId') === -1;
|
return userId === doc.userId && fieldNames.indexOf('userId') === -1;
|
||||||
}
|
}
|
||||||
|
Meteor.startup(() => {
|
||||||
|
UnsavedEditCollection._collection._ensureIndex({ userId: 1 });
|
||||||
|
});
|
||||||
UnsavedEditCollection.allow({
|
UnsavedEditCollection.allow({
|
||||||
insert: isAuthor,
|
insert: isAuthor,
|
||||||
update: isAuthor,
|
update: isAuthor,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue