mirror of
https://github.com/wekan/wekan.git
synced 2025-12-18 00:10:13 +01:00
[ENH] Add index on CardId into Comments collection
This commit is contained in:
parent
d11f069b60
commit
f71d2538fa
1 changed files with 4 additions and 4 deletions
|
|
@ -57,10 +57,10 @@ CardComments.helpers({
|
||||||
CardComments.hookOptions.after.update = { fetchPrevious: false };
|
CardComments.hookOptions.after.update = { fetchPrevious: false };
|
||||||
|
|
||||||
if (Meteor.isServer) {
|
if (Meteor.isServer) {
|
||||||
// Comments are often fetched within a card, so we create an index to make these
|
// Comments are often fetched within a card, so we create an index to make these
|
||||||
// queries more efficient.
|
// queries more efficient.
|
||||||
Meteor.startup(() => {
|
Meteor.startup(() => {
|
||||||
CardComments._collection._ensureIndex({ cardId: 1, createdAt: -1 });
|
CardComments._collection._ensureIndex({ cardId: 1, createdAt: -1 });
|
||||||
});
|
});
|
||||||
|
|
||||||
CardComments.after.insert((userId, doc) => {
|
CardComments.after.insert((userId, doc) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue