2022-07-15 09:47:18 +00:00
|
|
|
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
|
|
|
import { GroupPermission } from '../src/entities/group_permission.entity';
|
2021-11-15 06:13:48 +00:00
|
|
|
|
2022-07-15 09:47:18 +00:00
|
|
|
export class BackfillFolderCreatePermissionsAsTruthyForAdminGroup1636609569079 implements MigrationInterface {
|
2021-11-15 06:13:48 +00:00
|
|
|
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-11-15 06:13:48 +00:00
|
|
|
|
2022-07-15 09:47:18 +00:00
|
|
|
await GroupPermissionRepository.update({ group: 'admin' }, { folderCreate: true });
|
2021-11-15 06:13:48 +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-11-15 06:13:48 +00:00
|
|
|
|
2022-07-15 09:47:18 +00:00
|
|
|
await GroupPermissionRepository.update({ group: 'admin' }, { folderCreate: false });
|
2021-11-15 06:13:48 +00:00
|
|
|
}
|
|
|
|
|
}
|