This commit is contained in:
Kittapath 2024-05-28 10:47:34 +07:00
parent 2dac48cb81
commit dcd324fd37

View file

@ -0,0 +1,20 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class UpdateTableProfileAddDuty1716867925436 implements MigrationInterface {
name = 'UpdateTableProfileAddDuty1716867925436'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`profile\` ADD \`dutyTimeId\` varchar(40) NULL COMMENT 'ไอดีรอบลงเวลาล่าสุด'`);
await queryRunner.query(`ALTER TABLE \`profile\` ADD \`dutyTimeEffectiveDate\` datetime NULL COMMENT 'รอบลงเวลาล่าสุด'`);
await queryRunner.query(`ALTER TABLE \`profileHistory\` ADD \`dutyTimeId\` varchar(40) NULL COMMENT 'ไอดีรอบลงเวลาล่าสุด'`);
await queryRunner.query(`ALTER TABLE \`profileHistory\` ADD \`dutyTimeEffectiveDate\` datetime NULL COMMENT 'รอบลงเวลาล่าสุด'`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`profileHistory\` DROP COLUMN \`dutyTimeEffectiveDate\``);
await queryRunner.query(`ALTER TABLE \`profileHistory\` DROP COLUMN \`dutyTimeId\``);
await queryRunner.query(`ALTER TABLE \`profile\` DROP COLUMN \`dutyTimeEffectiveDate\``);
await queryRunner.query(`ALTER TABLE \`profile\` DROP COLUMN \`dutyTimeId\``);
}
}