diff --git a/apps/meteor/server/startup/migrations/index.ts b/apps/meteor/server/startup/migrations/index.ts index 57517ba796b6..9fb712401450 100644 --- a/apps/meteor/server/startup/migrations/index.ts +++ b/apps/meteor/server/startup/migrations/index.ts @@ -44,5 +44,6 @@ import './v308'; import './v309'; import './v310'; import './v311'; +import './v312'; export * from './xrun'; diff --git a/apps/meteor/server/startup/migrations/v312.ts b/apps/meteor/server/startup/migrations/v312.ts new file mode 100644 index 000000000000..aa0a96f148c5 --- /dev/null +++ b/apps/meteor/server/startup/migrations/v312.ts @@ -0,0 +1,20 @@ +import { LivechatRooms, Rooms, Subscriptions, Users } from '@rocket.chat/models'; + +import { addMigration } from '../../lib/migrations'; + +addMigration({ + version: 312, + async up() { + try { + await Promise.allSettled([ + 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); + } + }, +});