Compare commits

..

No commits in common. "c38da229da674a0e886372d299f3c337f2663e81" and "34e8ec8434bf4720930ea5032afe95ea197aa03a" have entirely different histories.

3 changed files with 0 additions and 35 deletions

View file

@ -188,12 +188,6 @@ export class Profile extends EntityBase {
})
keycloak: string;
@Column({
comment: "สถานะการถูกลบผู้ใช้งานใน keycloak",
default: false,
})
isDelete: boolean;
@Column({
comment: "ทดลองปฏิบัติหน้าที่",
default: false,

View file

@ -204,12 +204,6 @@ export class ProfileEmployee extends EntityBase {
})
keycloak: string;
@Column({
comment: "สถานะการถูกลบผู้ใช้งานใน keycloak",
default: false,
})
isDelete: boolean;
@Column({
comment: "ทดลองปฏิบัติหน้าที่",
default: false,

View file

@ -1,23 +0,0 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class UpdateProfileAndProfileemployeeAddFieldIsdelete1775112029663 implements MigrationInterface {
name = 'UpdateProfileAndProfileemployeeAddFieldIsdelete1775112029663'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`isDelete\` tinyint NOT NULL COMMENT 'สถานะการถูกลบผู้ใช้งานใน keycloak' DEFAULT 0`);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`isDelete\` tinyint NOT NULL COMMENT 'สถานะการถูกลบผู้ใช้งานใน keycloak' DEFAULT 0`);
await queryRunner.query(`ALTER TABLE \`profile\` ADD \`isDelete\` tinyint NOT NULL COMMENT 'สถานะการถูกลบผู้ใช้งานใน keycloak' DEFAULT 0`);
await queryRunner.query(`ALTER TABLE \`profileHistory\` ADD \`isDelete\` tinyint NOT NULL COMMENT 'สถานะการถูกลบผู้ใช้งานใน keycloak' DEFAULT 0`);
// Update ข้อมูลเดิม: ถ้า keycloak null → isDelete = true (1), ถ้ามีค่า → isDelete = false (0)
await queryRunner.query(`UPDATE \`profileEmployee\` SET \`isDelete\` = CASE WHEN \`keycloak\` IS NULL THEN 1 ELSE 0 END`);
await queryRunner.query(`UPDATE \`profile\` SET \`isDelete\` = CASE WHEN \`keycloak\` IS NULL THEN 1 ELSE 0 END`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`profileHistory\` DROP COLUMN \`isDelete\``);
await queryRunner.query(`ALTER TABLE \`profile\` DROP COLUMN \`isDelete\``);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`isDelete\``);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`isDelete\``);
}
}