chore: add migrations
This commit is contained in:
parent
b0292f3921
commit
be81477068
2 changed files with 36 additions and 0 deletions
|
|
@ -0,0 +1,16 @@
|
|||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class UpdateTableProfileInsigniaRelation1710758420804 implements MigrationInterface {
|
||||
name = 'UpdateTableProfileInsigniaRelation1710758420804'
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE \`profileInsignia\` DROP COLUMN \`insigniaType\``);
|
||||
await queryRunner.query(`ALTER TABLE \`profileInsignia\` ADD CONSTRAINT \`FK_7048ee3f58edbb05c9ab4e36a8d\` FOREIGN KEY (\`insigniaId\`) REFERENCES \`insignia\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE \`profileInsignia\` DROP FOREIGN KEY \`FK_7048ee3f58edbb05c9ab4e36a8d\``);
|
||||
await queryRunner.query(`ALTER TABLE \`profileInsignia\` ADD \`insigniaType\` text NULL COMMENT 'ประเภท'`);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue