2023-12-11 02:27:01 +00:00
|
|
|
import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm';
|
|
|
|
|
|
|
|
|
|
export class AddAutoLayoutFlagToPagesTable1702196735455 implements MigrationInterface {
|
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
|
|
|
// Add the new columns to the app_versions table
|
|
|
|
|
await queryRunner.addColumn(
|
|
|
|
|
'pages',
|
|
|
|
|
new TableColumn({
|
|
|
|
|
name: 'auto_compute_layout',
|
|
|
|
|
type: 'boolean',
|
|
|
|
|
isNullable: false,
|
|
|
|
|
default: 'false',
|
|
|
|
|
})
|
|
|
|
|
);
|
|
|
|
|
|
2024-03-01 13:22:03 +00:00
|
|
|
await queryRunner.addColumn(
|
|
|
|
|
'layouts',
|
2023-12-11 02:27:01 +00:00
|
|
|
new TableColumn({
|
2024-03-04 02:38:55 +00:00
|
|
|
name: 'dimension_unit',
|
2024-03-12 04:13:54 +00:00
|
|
|
type: 'enum',
|
|
|
|
|
enumName: 'dimension_unit',
|
|
|
|
|
enum: ['count', 'percent'],
|
2023-12-11 02:27:01 +00:00
|
|
|
isNullable: false,
|
2024-05-04 09:49:23 +00:00
|
|
|
default: `'percent'`,
|
2023-12-11 02:27:01 +00:00
|
|
|
})
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
|
|
|
await queryRunner.dropColumn('pages', 'auto_compute_layout');
|
|
|
|
|
}
|
|
|
|
|
}
|