diff --git a/apps/meteor/server/startup/migrations/index.ts b/apps/meteor/server/startup/migrations/index.ts index 26bc4f992ee2..8247f9a72bb5 100644 --- a/apps/meteor/server/startup/migrations/index.ts +++ b/apps/meteor/server/startup/migrations/index.ts @@ -36,4 +36,5 @@ import './v299'; import './v300'; import './v301'; import './v303'; +import './v304'; import './xrun'; diff --git a/apps/meteor/server/startup/migrations/v304.ts b/apps/meteor/server/startup/migrations/v304.ts new file mode 100644 index 000000000000..21d3a30cd961 --- /dev/null +++ b/apps/meteor/server/startup/migrations/v304.ts @@ -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); + } + }, +});