no message
This commit is contained in:
parent
0dd8d3d28a
commit
fa1f8dc3fb
1 changed files with 18 additions and 0 deletions
|
|
@ -0,0 +1,18 @@
|
|||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class UpdateTableSalaryProfileAddDiscipline1709884395224 implements MigrationInterface {
|
||||
name = 'UpdateTableSalaryProfileAddDiscipline1709884395224'
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`CREATE TABLE \`profileDiscipline\` (\`id\` varchar(36) NOT NULL, \`createdAt\` datetime(6) NOT NULL COMMENT 'สร้างข้อมูลเมื่อ' DEFAULT CURRENT_TIMESTAMP(6), \`createdUserId\` varchar(40) NOT NULL COMMENT 'User Id ที่สร้างข้อมูล' DEFAULT '00000000-0000-0000-0000-000000000000', \`lastUpdatedAt\` datetime(6) NOT NULL COMMENT 'แก้ไขข้อมูลล่าสุดเมื่อ' DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`lastUpdateUserId\` varchar(40) NOT NULL COMMENT 'User Id ที่แก้ไขข้อมูล' DEFAULT '00000000-0000-0000-0000-000000000000', \`createdFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่สร้างข้อมูล' DEFAULT 'string', \`lastUpdateFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่แก้ไขข้อมูลล่าสุด' DEFAULT 'string', \`date\` datetime NULL COMMENT 'วันที่', \`profileId\` varchar(40) NOT NULL COMMENT 'ไอดีโปรไฟล์', PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
|
||||
await queryRunner.query(`ALTER TABLE \`profile\` ADD \`dateRetire\` datetime NULL COMMENT 'วันที่พักราชการ'`);
|
||||
await queryRunner.query(`ALTER TABLE \`profileDiscipline\` ADD CONSTRAINT \`FK_0031dcb981836876de8524eaff1\` FOREIGN KEY (\`profileId\`) REFERENCES \`profile\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE \`profileDiscipline\` DROP FOREIGN KEY \`FK_0031dcb981836876de8524eaff1\``);
|
||||
await queryRunner.query(`ALTER TABLE \`profile\` DROP COLUMN \`dateRetire\``);
|
||||
await queryRunner.query(`DROP TABLE \`profileDiscipline\``);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue