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
|
|
|
|
|
|
|
|
export class BackfillFolderDeleteFolderUpdatePermissionsAsTruthyForAdminGroup1653474337657
|
|
|
|
|
implements MigrationInterface
|
|
|
|
|
{
|
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
|
|
|
const entityManager = queryRunner.manager;
|
|
|
|
|
const GroupPermissionRepostory = entityManager.getRepository(GroupPermission);
|
|
|
|
|
|
|
|
|
|
await GroupPermissionRepostory.update({ group: 'admin' }, { folderUpdate: true, folderDelete: true });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
|
|
|
const entityManager = queryRunner.manager;
|
|
|
|
|
const GroupPermissionRepostory = entityManager.getRepository(GroupPermission);
|
|
|
|
|
|
|
|
|
|
await GroupPermissionRepostory.update({ group: 'admin' }, { folderUpdate: false, folderDelete: false });
|
|
|
|
|
}
|
|
|
|
|
}
|