The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/server/startup/migrations/v059.js

14 lines
524 B

import { Migrations } from '../../../app/migrations';
import { Users, Settings, Statistics } from '../../../app/models';
Migrations.add({
version: 59,
up() {
const users = Users.find({}, { sort: { createdAt: 1 }, limit: 1 }).fetch();
if (users && users.length > 0) {
const { createdAt } = users[0];
Settings.update({ createdAt: { $exists: 0 } }, { $set: { createdAt } }, { multi: true });
Statistics.update({ installedAt: { $exists: 0 } }, { $set: { installedAt: createdAt } }, { multi: true });
}
},
});