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/v163.js

28 lines
504 B

import { Migrations } from '../../../app/migrations';
import { Uploads } from '../../../app/models';
Migrations.add({
version: 163,
up() {
/*
* Migrate existing `rocketchat_uploads` documents to include the typeGroup
*/
Uploads.find({
type: {
$exists: true,
},
typeGroup: {
$exists: false,
},
}).forEach((upload) => {
Uploads.model.direct.update({
_id: upload._id,
}, {
$set: {
typeGroup: upload.type.split('/').shift(),
},
});
});
},
});