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\``); + } + +}