From 59d0e30192324ac38d26ba36743af5ea6cf63e22 Mon Sep 17 00:00:00 2001 From: Bright Date: Fri, 6 Dec 2024 17:57:19 +0700 Subject: [PATCH] add field commandType.isSalary --- src/entities/CommandType.ts | 6 ++++++ ...389096-update_table_commandType_add_isSalary.ts | 14 ++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 src/migration/1733482389096-update_table_commandType_add_isSalary.ts diff --git a/src/entities/CommandType.ts b/src/entities/CommandType.ts index 86a34ba3..f3fb87fe 100644 --- a/src/entities/CommandType.ts +++ b/src/entities/CommandType.ts @@ -80,6 +80,12 @@ export class CommandType extends EntityBase { }) isAttachment: boolean; + @Column({ + comment: "สถานะแก้ไขเงินเดือน", + default: true, + }) + isSalary: boolean; + @Column({ nullable: true, comment: "คำอธิบาย", diff --git a/src/migration/1733482389096-update_table_commandType_add_isSalary.ts b/src/migration/1733482389096-update_table_commandType_add_isSalary.ts new file mode 100644 index 00000000..0ebc05fd --- /dev/null +++ b/src/migration/1733482389096-update_table_commandType_add_isSalary.ts @@ -0,0 +1,14 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateTableCommandTypeAddIsSalary1733482389096 implements MigrationInterface { + name = 'UpdateTableCommandTypeAddIsSalary1733482389096' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`commandType\` ADD \`isSalary\` tinyint NOT NULL COMMENT 'สถานะแก้ไขเงินเดือน' DEFAULT 1`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`commandType\` DROP COLUMN \`isSalary\``); + } + +}