2025-02-25 06:52:50 +00:00
|
|
|
import { AppVersion } from '@entities/app_version.entity';
|
2021-10-05 07:07:17 +00:00
|
|
|
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
|
|
|
|
|
|
|
|
export class SetShowBulkSelectorToTrue1633370361564 implements MigrationInterface {
|
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
|
|
|
const entityManager = queryRunner.manager;
|
|
|
|
|
const queryBuilder = queryRunner.connection.createQueryBuilder();
|
|
|
|
|
const appVersionRepository = entityManager.getRepository(AppVersion);
|
|
|
|
|
|
|
|
|
|
const appVersions = await appVersionRepository.find();
|
|
|
|
|
|
|
|
|
|
for (const version of appVersions) {
|
|
|
|
|
const definition = version['definition'];
|
|
|
|
|
|
|
|
|
|
if (definition) {
|
|
|
|
|
const components = definition['components'];
|
|
|
|
|
|
|
|
|
|
for (const componentId of Object.keys(components)) {
|
|
|
|
|
const component = components[componentId];
|
|
|
|
|
|
|
|
|
|
if (component.component.component === 'Table') {
|
|
|
|
|
component.component.definition.properties.showBulkSelector = { value: false };
|
|
|
|
|
components[componentId] = {
|
|
|
|
|
...component,
|
|
|
|
|
component: {
|
|
|
|
|
...component.component,
|
|
|
|
|
definition: {
|
|
|
|
|
...component.component.definition,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
definition['components'] = components;
|
|
|
|
|
version.definition = definition;
|
|
|
|
|
|
|
|
|
|
await queryBuilder.update(AppVersion).set({ definition }).where('id = :id', { id: version.id }).execute();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {}
|
|
|
|
|
}
|