[FIX] Startup errors creating indexes (#24409)

pull/24334/head^2
Diego Sampaio 4 years ago committed by GitHub
parent 949115a5ed
commit d254da574a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      server/startup/migrations/index.ts
  2. 13
      server/startup/migrations/v254.ts

@ -77,4 +77,5 @@ import './v250';
import './v251';
import './v252';
import './v253';
import './v254';
import './xrun';

@ -0,0 +1,13 @@
import { addMigration } from '../../lib/migrations';
import { Users, Rooms } from '../../../app/models/server';
addMigration({
version: 254,
up() {
Users.tryDropIndex({ bio: 1 });
Users.tryEnsureIndex({ bio: 1 }, { unique: 1 });
Rooms.tryDropIndex({ prid: 1 });
Rooms.tryEnsureIndex({ prid: 1 }, { sparse: true });
},
});
Loading…
Cancel
Save