From c264558a2cb5e29b3e095e4e162b4357758b07b7 Mon Sep 17 00:00:00 2001 From: Methapon2001 <61303214+Methapon2001@users.noreply.github.com> Date: Mon, 18 Mar 2024 16:02:37 +0700 Subject: [PATCH] feat: add migration --- ...1-update_table_profile_history_add_is_date.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/migration/1710752446531-update_table_profile_history_add_is_date.ts diff --git a/src/migration/1710752446531-update_table_profile_history_add_is_date.ts b/src/migration/1710752446531-update_table_profile_history_add_is_date.ts new file mode 100644 index 00000000..bc408b1d --- /dev/null +++ b/src/migration/1710752446531-update_table_profile_history_add_is_date.ts @@ -0,0 +1,16 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateTableProfileHistoryAddIsDate1710752446531 implements MigrationInterface { + name = 'UpdateTableProfileHistoryAddIsDate1710752446531' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`profileHonorHistory\` ADD \`isDate\` tinyint NULL COMMENT 'ประเภทช่วงเวลาการศึกษา'`); + await queryRunner.query(`ALTER TABLE \`profileTrainingHistory\` ADD \`isDate\` tinyint NULL COMMENT 'ประเภทช่วงเวลาการศึกษา'`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`profileTrainingHistory\` DROP COLUMN \`isDate\``); + await queryRunner.query(`ALTER TABLE \`profileHonorHistory\` DROP COLUMN \`isDate\``); + } + +}