migrate
This commit is contained in:
parent
c1d73486af
commit
c7ca78c13c
1 changed files with 16 additions and 0 deletions
|
|
@ -0,0 +1,16 @@
|
|||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class UpdateTableProfileempAddGroup21717741744850 implements MigrationInterface {
|
||||
name = 'UpdateTableProfileempAddGroup21717741744850'
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE \`profileEmployeeEmployment\` ADD \`profileEmployeeId\` varchar(40) NULL COMMENT 'คีย์นอก(FK)ของตาราง ProfileEmployee'`);
|
||||
await queryRunner.query(`ALTER TABLE \`profileEmployeeEmployment\` ADD CONSTRAINT \`FK_229d969d15790aae298399f9303\` 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 \`profileEmployeeEmployment\` DROP FOREIGN KEY \`FK_229d969d15790aae298399f9303\``);
|
||||
await queryRunner.query(`ALTER TABLE \`profileEmployeeEmployment\` DROP COLUMN \`profileEmployeeId\``);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue