diff --git a/src/migration/1715930569091-update_table_govemployee.ts b/src/migration/1715930569091-update_table_govemployee.ts new file mode 100644 index 00000000..ec42f953 --- /dev/null +++ b/src/migration/1715930569091-update_table_govemployee.ts @@ -0,0 +1,32 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateTableGovemployee1715930569091 implements MigrationInterface { + name = 'UpdateTableGovemployee1715930569091' + + public async up(queryRunner: QueryRunner): Promise { + 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 { + 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\``); + } + +}