mirror of
https://github.com/ToolJet/ToolJet
synced 2026-04-21 21:47:17 +00:00
18 lines
838 B
TypeScript
18 lines
838 B
TypeScript
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
import { GroupPermission } from '@entities/group_permission.entity';
|
|
|
|
export class BackfillAppCreatePermissionsAsTruthyForAdminGroup1634729050892 implements MigrationInterface {
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
const entityManager = queryRunner.manager;
|
|
const GroupPermissionRepostory = entityManager.getRepository(GroupPermission);
|
|
|
|
await GroupPermissionRepostory.update({ group: 'admin' }, { appCreate: true, appDelete: true });
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
const entityManager = queryRunner.manager;
|
|
const GroupPermissionRepostory = entityManager.getRepository(GroupPermission);
|
|
|
|
await GroupPermissionRepostory.update({ group: 'admin' }, { appCreate: false, appDelete: false });
|
|
}
|
|
}
|