From 72e3e66afe54fef62005f793a64e2216752f4844 Mon Sep 17 00:00:00 2001 From: "DESKTOP-2S5P7D1\\Windows 10" Date: Mon, 6 Jan 2025 12:13:26 +0700 Subject: [PATCH] migrate --- .../1736140332359-update_eva_add_root.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/migration/1736140332359-update_eva_add_root.ts diff --git a/src/migration/1736140332359-update_eva_add_root.ts b/src/migration/1736140332359-update_eva_add_root.ts new file mode 100644 index 0000000..434ad04 --- /dev/null +++ b/src/migration/1736140332359-update_eva_add_root.ts @@ -0,0 +1,16 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateEvaAddRoot1736140332359 implements MigrationInterface { + name = 'UpdateEvaAddRoot1736140332359' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`evaluation\` ADD \`root\` varchar(255) NULL COMMENT 'สำนักงานที่สังกัด'`); + await queryRunner.query(`ALTER TABLE \`evaluation\` ADD \`orgRootId\` varchar(255) NULL COMMENT 'ไอดีสำนักงานที่สังกัด'`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`evaluation\` DROP COLUMN \`orgRootId\``); + await queryRunner.query(`ALTER TABLE \`evaluation\` DROP COLUMN \`root\``); + } + +}