From 62166c430eea1bdfcd26b61cadc7d19ce40f8f5b Mon Sep 17 00:00:00 2001 From: Kittapath Date: Thu, 16 May 2024 12:23:37 +0700 Subject: [PATCH] no message --- ...update_table_ProfileAvatar_add_isactive2.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/migration/1715836928018-update_table_ProfileAvatar_add_isactive2.ts diff --git a/src/migration/1715836928018-update_table_ProfileAvatar_add_isactive2.ts b/src/migration/1715836928018-update_table_ProfileAvatar_add_isactive2.ts new file mode 100644 index 00000000..e387096f --- /dev/null +++ b/src/migration/1715836928018-update_table_ProfileAvatar_add_isactive2.ts @@ -0,0 +1,18 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateTableProfileAvatarAddIsactive21715836928018 implements MigrationInterface { + name = 'UpdateTableProfileAvatarAddIsactive21715836928018' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`avatarName\` varchar(255) NULL COMMENT 'รูปถ่าย'`); + await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`avatarName\` varchar(255) NULL COMMENT 'รูปถ่าย'`); + await queryRunner.query(`ALTER TABLE \`profileSalaryEmployee\` CHANGE \`commandTypeName\` \`commandTypeName\` text NULL COMMENT 'ประเภทคำสั่ง'`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`profileSalaryEmployee\` CHANGE \`commandTypeName\` \`commandTypeName\` text NOT NULL COMMENT 'ประเภทคำสั่ง'`); + await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`avatarName\``); + await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`avatarName\``); + } + +}