Skip to content

Commit

Permalink
chore: migration to remove redundant indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
sampaiodiego committed Nov 10, 2023
1 parent e05a530 commit 0dabcaf
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions apps/meteor/server/startup/migrations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ import './v299';
import './v300';
import './v301';
import './v303';
import './v304';
import './xrun';
20 changes: 20 additions & 0 deletions apps/meteor/server/startup/migrations/v304.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { LivechatRooms, Rooms, Subscriptions, Users } from '@rocket.chat/models';

import { addMigration } from '../../lib/migrations';

addMigration({
version: 304,
async up() {
try {
await Promise.all([
LivechatRooms.col.dropIndex('v.token_1'),
Rooms.col.dropIndex('t_1'),
Subscriptions.col.dropIndex('rid_1'),
Users.col.dropIndex('active_1'),
]);
} catch (error: unknown) {
console.warn('Error dropping redundant indexes, continuing...');
console.warn(error);
}
},
});

0 comments on commit 0dabcaf

Please sign in to comment.