เพิ่มประวัติลูกจ้าง

This commit is contained in:
Kittapath 2024-04-03 12:07:57 +07:00
parent e9732a1e52
commit 44022b311f
6 changed files with 316 additions and 2 deletions

View file

@ -0,0 +1,20 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class UpdateTableDevelopmentHistoryAddType1712120794817 implements MigrationInterface {
name = 'UpdateTableDevelopmentHistoryAddType1712120794817'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`developmentHistory\` ADD \`employeePosLevelId\` varchar(40) NULL COMMENT 'ไอดีระดับตำแหน่ง'`);
await queryRunner.query(`ALTER TABLE \`developmentHistory\` ADD \`employeePosTypeId\` varchar(40) NULL COMMENT 'ไอดีประเภทตำแหน่ง'`);
await queryRunner.query(`ALTER TABLE \`developmentHistory\` ADD CONSTRAINT \`FK_a905f077069e27d2fc9bb8f5f5c\` FOREIGN KEY (\`employeePosLevelId\`) REFERENCES \`employeePosLevel\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
await queryRunner.query(`ALTER TABLE \`developmentHistory\` ADD CONSTRAINT \`FK_25dd3134b725bb2ec455872374f\` FOREIGN KEY (\`employeePosTypeId\`) REFERENCES \`employeePosType\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`developmentHistory\` DROP FOREIGN KEY \`FK_25dd3134b725bb2ec455872374f\``);
await queryRunner.query(`ALTER TABLE \`developmentHistory\` DROP FOREIGN KEY \`FK_a905f077069e27d2fc9bb8f5f5c\``);
await queryRunner.query(`ALTER TABLE \`developmentHistory\` DROP COLUMN \`employeePosTypeId\``);
await queryRunner.query(`ALTER TABLE \`developmentHistory\` DROP COLUMN \`employeePosLevelId\``);
}
}