migrate
This commit is contained in:
parent
391501b665
commit
71cbecdce0
1 changed files with 32 additions and 0 deletions
32
src/migration/1715930569091-update_table_govemployee.ts
Normal file
32
src/migration/1715930569091-update_table_govemployee.ts
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class UpdateTableGovemployee1715930569091 implements MigrationInterface {
|
||||
name = 'UpdateTableGovemployee1715930569091'
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`dateAppoint\` datetime NULL COMMENT 'วันที่บรรจุ'`);
|
||||
await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`dateStart\` datetime NULL COMMENT 'วันที่เริ่มปฏิบัติราชการ'`);
|
||||
await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`govAgeAbsent\` int NULL COMMENT 'ขาดราชการ'`);
|
||||
await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`govAgePlus\` int NULL COMMENT 'อายุราชการเกื้อกูล'`);
|
||||
await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`reasonSameDate\` varchar(255) NULL COMMENT 'เหตุผลกรณีวันไม่ตรงกัน'`);
|
||||
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`dateAppoint\` datetime NULL COMMENT 'วันที่บรรจุ'`);
|
||||
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`dateStart\` datetime NULL COMMENT 'วันที่เริ่มปฏิบัติราชการ'`);
|
||||
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`govAgeAbsent\` int NULL COMMENT 'ขาดราชการ'`);
|
||||
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`govAgePlus\` int NULL COMMENT 'อายุราชการเกื้อกูล'`);
|
||||
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`reasonSameDate\` varchar(255) NULL COMMENT 'เหตุผลกรณีวันไม่ตรงกัน'`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`reasonSameDate\``);
|
||||
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`govAgePlus\``);
|
||||
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`govAgeAbsent\``);
|
||||
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`dateStart\``);
|
||||
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`dateAppoint\``);
|
||||
await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`reasonSameDate\``);
|
||||
await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`govAgePlus\``);
|
||||
await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`govAgeAbsent\``);
|
||||
await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`dateStart\``);
|
||||
await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`dateAppoint\``);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue