This commit is contained in:
Kittapath 2024-05-13 17:52:55 +07:00
parent be804c356a
commit 660deeb3a4

View file

@ -0,0 +1,16 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class UpdateTableProfileemployeeAddPk31715597418469 implements MigrationInterface {
name = 'UpdateTableProfileemployeeAddPk31715597418469'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`profileOther\` ADD \`profileEmployeeId\` varchar(40) NULL COMMENT 'คีย์นอก(FK)ของตาราง ProfileEmployee'`);
await queryRunner.query(`ALTER TABLE \`profileOther\` ADD CONSTRAINT \`FK_b7ef3007bce554a41bdb896ed96\` FOREIGN KEY (\`profileEmployeeId\`) REFERENCES \`profileEmployee\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`profileOther\` DROP FOREIGN KEY \`FK_b7ef3007bce554a41bdb896ed96\``);
await queryRunner.query(`ALTER TABLE \`profileOther\` DROP COLUMN \`profileEmployeeId\``);
}
}