hrms-api-org/src/migration/1727752118300-update_ProfileDevelopment.ts
2024-10-01 10:30:03 +07:00

24 lines
1.7 KiB
TypeScript

import { MigrationInterface, QueryRunner } from "typeorm";
export class UpdateProfileDevelopment1727752118300 implements MigrationInterface {
name = 'UpdateProfileDevelopment1727752118300'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`profileDevelopmentHistory\` DROP COLUMN \`point\``);
await queryRunner.query(`ALTER TABLE \`profileDevelopmentHistory\` DROP COLUMN \`summary\``);
await queryRunner.query(`ALTER TABLE \`profileDevelopmentHistory\` DROP COLUMN \`target\``);
await queryRunner.query(`ALTER TABLE \`profileDevelopment\` DROP COLUMN \`point\``);
await queryRunner.query(`ALTER TABLE \`profileDevelopment\` DROP COLUMN \`summary\``);
await queryRunner.query(`ALTER TABLE \`profileDevelopment\` DROP COLUMN \`target\``);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`profileDevelopment\` ADD \`target\` varchar(255) NULL COMMENT 'เป้าหมาย'`);
await queryRunner.query(`ALTER TABLE \`profileDevelopment\` ADD \`summary\` double NULL COMMENT 'ผลการประเมิน'`);
await queryRunner.query(`ALTER TABLE \`profileDevelopment\` ADD \`point\` int NULL COMMENT 'ระดับคะแนน'`);
await queryRunner.query(`ALTER TABLE \`profileDevelopmentHistory\` ADD \`target\` varchar(255) NULL COMMENT 'เป้าหมาย'`);
await queryRunner.query(`ALTER TABLE \`profileDevelopmentHistory\` ADD \`summary\` double NULL COMMENT 'ผลการประเมิน'`);
await queryRunner.query(`ALTER TABLE \`profileDevelopmentHistory\` ADD \`point\` int NULL COMMENT 'ระดับคะแนน'`);
}
}