From bd9b8b41838bc790c0bca8195f0db338c4018f68 Mon Sep 17 00:00:00 2001 From: Kittapath Date: Tue, 21 May 2024 12:55:17 +0700 Subject: [PATCH] migrate --- ...6270845115-update_table_dev_reason_text.ts | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/migration/1716270845115-update_table_dev_reason_text.ts diff --git a/src/migration/1716270845115-update_table_dev_reason_text.ts b/src/migration/1716270845115-update_table_dev_reason_text.ts new file mode 100644 index 0000000..ca35c0c --- /dev/null +++ b/src/migration/1716270845115-update_table_dev_reason_text.ts @@ -0,0 +1,20 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateTableDevReasonText1716270845115 implements MigrationInterface { + name = 'UpdateTableDevReasonText1716270845115' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`development\` DROP COLUMN \`reason\``); + await queryRunner.query(`ALTER TABLE \`development\` ADD \`reason\` text NULL COMMENT 'หลักการและเหตุผล'`); + await queryRunner.query(`ALTER TABLE \`development\` DROP COLUMN \`objective\``); + await queryRunner.query(`ALTER TABLE \`development\` ADD \`objective\` text NULL COMMENT 'วัตถุประสงค์'`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`development\` DROP COLUMN \`objective\``); + await queryRunner.query(`ALTER TABLE \`development\` ADD \`objective\` varchar(255) NULL COMMENT 'วัตถุประสงค์'`); + await queryRunner.query(`ALTER TABLE \`development\` DROP COLUMN \`reason\``); + await queryRunner.query(`ALTER TABLE \`development\` ADD \`reason\` varchar(255) NULL COMMENT 'หลักการและเหตุผล'`); + } + +}