Migrate #2481
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m3s
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m3s
This commit is contained in:
parent
825263c11c
commit
8bd4a816e8
4 changed files with 33 additions and 0 deletions
|
|
@ -5594,6 +5594,7 @@ export class CommandController extends Controller {
|
|||
date: item.commandDateAffect,
|
||||
refCommandDate: item.commandDateSign,
|
||||
refCommandNo: `${item.commandNo}/${item.commandYear}`,
|
||||
refCommandId: item.commandId,
|
||||
createdUserId: req.user.sub,
|
||||
createdFullName: req.user.name,
|
||||
lastUpdateUserId: req.user.sub,
|
||||
|
|
@ -6117,6 +6118,7 @@ export class CommandController extends Controller {
|
|||
date: item.commandDateAffect,
|
||||
refCommandDate: item.commandDateSign,
|
||||
refCommandNo: `${item.commandNo}/${item.commandYear}`,
|
||||
refCommandId: item.commandId,
|
||||
profileEmployeeId: item.profileId,
|
||||
profileId: undefined,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -61,6 +61,14 @@ export class ProfileDiscipline extends EntityBase {
|
|||
default: null,
|
||||
})
|
||||
refCommandNo: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 40,
|
||||
comment: "คีย์นอก(FK)ของตาราง command",
|
||||
default: null,
|
||||
})
|
||||
refCommandId: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
|
|
|
|||
|
|
@ -51,6 +51,14 @@ export class ProfileDisciplineHistory extends EntityBase {
|
|||
})
|
||||
refCommandNo: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 40,
|
||||
comment: "คีย์นอก(FK)ของตาราง command",
|
||||
default: null,
|
||||
})
|
||||
refCommandId: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ล้างมลทิน",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class UpdateProfileDisciplineAddRefCommandId1780634210221 implements MigrationInterface {
|
||||
name = 'UpdateProfileDisciplineAddRefCommandId1780634210221'
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE \`profileDisciplineHistory\` ADD \`refCommandId\` varchar(40) NULL COMMENT 'คีย์นอก(FK)ของตาราง command'`);
|
||||
await queryRunner.query(`ALTER TABLE \`profileDiscipline\` ADD \`refCommandId\` varchar(40) NULL COMMENT 'คีย์นอก(FK)ของตาราง command'`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE \`profileDiscipline\` DROP COLUMN \`refCommandId\``);
|
||||
await queryRunner.query(`ALTER TABLE \`profileDisciplineHistory\` DROP COLUMN \`refCommandId\``);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue