Co-authored-by: sealday <sealday@gmail.com> Reviewed-on: daoyoucloud/tachybase#1366
19 lines
420 B
TypeScript
19 lines
420 B
TypeScript
import { Migration } from '@tachybase/server';
|
|
|
|
export default class AddUsersSpecialRoleMigration extends Migration {
|
|
on = 'afterLoad';
|
|
appVersion = '<0.21.88';
|
|
|
|
async up() {
|
|
const repo = this.context.db.getRepository('users');
|
|
await repo.update({
|
|
filter: { $and: [{ roles: { title: { $includes: 'root' } } }] },
|
|
values: {
|
|
specialRole: 'root',
|
|
},
|
|
});
|
|
}
|
|
|
|
async down() {}
|
|
}
|