2022-07-15 09:47:18 +00:00
|
|
|
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
|
|
|
import { GroupPermission } from '../src/entities/group_permission.entity';
|
2021-12-06 19:07:19 +00:00
|
|
|
|
|
|
|
|
export class BackfillFolderCreatePermissionsAsTruthyForMissedAdminGroup1638796825499 implements MigrationInterface {
|
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
|
|
|
const entityManager = queryRunner.manager;
|
2022-07-15 09:47:18 +00:00
|
|
|
const GroupPermissionRepository = entityManager.getRepository(GroupPermission);
|
2021-12-06 19:07:19 +00:00
|
|
|
|
2022-07-15 09:47:18 +00:00
|
|
|
await GroupPermissionRepository.update({ group: 'admin', folderCreate: false }, { folderCreate: true });
|
2021-12-06 19:07:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
|
|
|
const entityManager = queryRunner.manager;
|
2022-07-15 09:47:18 +00:00
|
|
|
const GroupPermissionRepository = entityManager.getRepository(GroupPermission);
|
2021-12-06 19:07:19 +00:00
|
|
|
|
2022-07-15 09:47:18 +00:00
|
|
|
await GroupPermissionRepository.update({ group: 'admin' }, { folderCreate: false });
|
2021-12-06 19:07:19 +00:00
|
|
|
}
|
|
|
|
|
}
|