mirror of
https://github.com/wekan/wekan.git
synced 2025-04-20 12:07:11 -04:00
Merge pull request #18 from fmonthel/devel
[ENH] Add index on CardId into Comments collection
This commit is contained in:
commit
693f615136
1 changed files with 6 additions and 0 deletions
|
@ -57,6 +57,12 @@ CardComments.helpers({
|
|||
CardComments.hookOptions.after.update = { fetchPrevious: false };
|
||||
|
||||
if (Meteor.isServer) {
|
||||
// Comments are often fetched within a card, so we create an index to make these
|
||||
// queries more efficient.
|
||||
Meteor.startup(() => {
|
||||
CardComments._collection._ensureIndex({ cardId: 1, createdAt: -1 });
|
||||
});
|
||||
|
||||
CardComments.after.insert((userId, doc) => {
|
||||
Activities.insert({
|
||||
userId,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue