migrate
This commit is contained in:
parent
2dac48cb81
commit
dcd324fd37
1 changed files with 20 additions and 0 deletions
20
src/migration/1716867925436-update_table_profile_add_duty.ts
Normal file
20
src/migration/1716867925436-update_table_profile_add_duty.ts
Normal 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\``);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue