2022-06-16 14:11:38 +00:00
|
|
|
import { MigrationInterface, QueryRunner } from 'typeorm';
|
2025-02-25 06:52:50 +00:00
|
|
|
import { GroupPermission } from '@entities/group_permission.entity';
|
2022-06-16 14:11:38 +00:00
|
|
|
|
2026-02-09 16:31:08 +00:00
|
|
|
export class BackfillFolderDeleteFolderUpdatePermissionsAsTruthyForAdminGroup1653474337657 implements MigrationInterface {
|
2022-06-16 14:11:38 +00:00
|
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
|
|
|
const entityManager = queryRunner.manager;
|
2026-02-09 16:31:08 +00:00
|
|
|
const GroupPermissionRepository = entityManager.getRepository(GroupPermission);
|
2022-06-16 14:11:38 +00:00
|
|
|
|
2026-02-09 16:31:08 +00:00
|
|
|
await GroupPermissionRepository.update({ group: 'admin' }, { folderUpdate: true, folderDelete: true });
|
2022-06-16 14:11:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
|
|
|
const entityManager = queryRunner.manager;
|
2026-02-09 16:31:08 +00:00
|
|
|
const GroupPermissionRepository = entityManager.getRepository(GroupPermission);
|
2022-06-16 14:11:38 +00:00
|
|
|
|
2026-02-09 16:31:08 +00:00
|
|
|
await GroupPermissionRepository.update({ group: 'admin' }, { folderUpdate: false, folderDelete: false });
|
2022-06-16 14:11:38 +00:00
|
|
|
}
|
|
|
|
|
}
|