20 lines
1.4 KiB
TypeScript
20 lines
1.4 KiB
TypeScript
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\``);
|
|
}
|
|
|
|
}
|