api ออกคำสั่ง
This commit is contained in:
parent
566ac716ee
commit
000bc2aad9
3 changed files with 93 additions and 65 deletions
22
src/migration/1727795520589-update_ProfileDevelopment1.ts
Normal file
22
src/migration/1727795520589-update_ProfileDevelopment1.ts
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class UpdateProfileDevelopment11727795520589 implements MigrationInterface {
|
||||
name = 'UpdateProfileDevelopment11727795520589'
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE \`commandRecive\` DROP FOREIGN KEY \`FK_fb29bfd315d0d43d0b49b362995\``);
|
||||
await queryRunner.query(`ALTER TABLE \`commandRecive\` DROP COLUMN \`org\``);
|
||||
await queryRunner.query(`ALTER TABLE \`commandRecive\` DROP COLUMN \`position\``);
|
||||
await queryRunner.query(`ALTER TABLE \`commandRecive\` DROP COLUMN \`profileId\``);
|
||||
await queryRunner.query(`ALTER TABLE \`commandRecive\` ADD \`refId\` varchar(40) NULL COMMENT 'refId'`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE \`commandRecive\` DROP COLUMN \`refId\``);
|
||||
await queryRunner.query(`ALTER TABLE \`commandRecive\` ADD \`profileId\` varchar(40) NOT NULL COMMENT 'คีย์นอก(FK)ของตาราง profile'`);
|
||||
await queryRunner.query(`ALTER TABLE \`commandRecive\` ADD \`position\` varchar(255) NULL COMMENT 'ตำแหน่ง'`);
|
||||
await queryRunner.query(`ALTER TABLE \`commandRecive\` ADD \`org\` varchar(255) NULL COMMENT 'หน่วยงาน'`);
|
||||
await queryRunner.query(`ALTER TABLE \`commandRecive\` ADD CONSTRAINT \`FK_fb29bfd315d0d43d0b49b362995\` FOREIGN KEY (\`profileId\`) REFERENCES \`profile\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue