table profileHonor add isUpload

This commit is contained in:
kittapath 2025-01-28 14:37:40 +07:00
parent 76a994d7df
commit 8b699f6441
10 changed files with 81 additions and 3 deletions

View file

@ -62,6 +62,12 @@ export class ProfileAbility extends EntityBase {
})
field: string;
@Column({
comment: "แนบไฟล์เอกสาร",
default: false,
})
isUpload: boolean;
@Column({
nullable: true,
length: 40,
@ -112,4 +118,5 @@ export type UpdateProfileAbility = {
dateStart?: Date | null;
dateEnd?: Date | null;
field?: string | null;
isUpload?: boolean | null;
};

View file

@ -52,6 +52,12 @@ export class ProfileAbilityHistory extends EntityBase {
})
field: string;
@Column({
comment: "แนบไฟล์เอกสาร",
default: false,
})
isUpload: boolean;
@Column({
nullable: true,
length: 40,

View file

@ -87,7 +87,6 @@ export class CreateProfileAssistance {
dateEnd: Date | null;
commandNo: string | null;
document: string | null;
isUpload: boolean;
}
export class CreateProfileAssistanceEmployee {
@ -97,7 +96,6 @@ export class CreateProfileAssistanceEmployee {
dateEnd: Date | null;
commandNo: string | null;
document: string | null;
isUpload: boolean;
}
export type UpdateProfileAssistance = {
@ -106,5 +104,5 @@ export type UpdateProfileAssistance = {
dateEnd?: Date | null;
commandNo?: string | null;
document?: string | null;
isUpload: boolean;
isUpload?: boolean | null;
};

View file

@ -70,6 +70,12 @@ export class ProfileDuty extends EntityBase {
})
refCommandNo: string;
@Column({
comment: "แนบไฟล์เอกสาร",
default: false,
})
isUpload: boolean;
@OneToMany(() => ProfileDutyHistory, (profileDutyHistory) => profileDutyHistory.histories)
profileDutyHistories: ProfileDutyHistory[];
@ -109,4 +115,5 @@ export type UpdateProfileDuty = {
reference?: string | null;
refCommandDate?: Date | null;
refCommandNo?: string | null;
isUpload?: boolean | null;
};

View file

@ -52,6 +52,12 @@ export class ProfileDutyHistory extends EntityBase {
})
refCommandNo: string;
@Column({
comment: "แนบไฟล์เอกสาร",
default: false,
})
isUpload: boolean;
@Column({
nullable: true,
length: 40,

View file

@ -77,6 +77,12 @@ export class ProfileHonor extends EntityBase {
})
isDate: boolean;
@Column({
comment: "แนบไฟล์เอกสาร",
default: false,
})
isUpload: boolean;
@OneToMany(() => ProfileHonorHistory, (profileHonorHistory) => profileHonorHistory.histories)
profileHonorHistories: ProfileHonorHistory[];
@ -119,4 +125,5 @@ export type UpdateProfileHonor = {
refCommandNo?: string | null;
type?: string | null;
isDate: boolean | null;
isUpload?: boolean | null;
};

View file

@ -67,6 +67,12 @@ export class ProfileHonorHistory extends EntityBase {
})
isDate: boolean;
@Column({
comment: "แนบไฟล์เอกสาร",
default: false,
})
isUpload: boolean;
@ManyToOne(() => ProfileHonor, (profileHonor) => profileHonor.profileHonorHistories)
@JoinColumn({ name: "profileHonorId" })
histories: ProfileHonor;

View file

@ -115,6 +115,12 @@ export class ProfileInsignia extends EntityBase {
})
note: string;
@Column({
comment: "แนบไฟล์เอกสาร",
default: false,
})
isUpload: boolean;
@Column({
nullable: true,
length: 40,
@ -190,4 +196,5 @@ export type UpdateProfileInsignia = {
refCommandDate?: Date | null;
refCommandNo?: string | null;
note?: string | null;
isUpload?: boolean | null;
};

View file

@ -47,6 +47,12 @@ export class ProfileInsigniaHistory extends EntityBase {
@Column({ nullable: true, comment: "หมายเหตุ", default: null })
note: string;
@Column({
comment: "แนบไฟล์เอกสาร",
default: false,
})
isUpload: boolean;
@Column({
nullable: true,
length: 40,

View file

@ -0,0 +1,28 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class UpdateprofileHonoraddisUpload1738049529701 implements MigrationInterface {
name = 'UpdateprofileHonoraddisUpload1738049529701'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`profileInsigniaHistory\` ADD \`isUpload\` tinyint NOT NULL COMMENT 'แนบไฟล์เอกสาร' DEFAULT 0`);
await queryRunner.query(`ALTER TABLE \`profileInsignia\` ADD \`isUpload\` tinyint NOT NULL COMMENT 'แนบไฟล์เอกสาร' DEFAULT 0`);
await queryRunner.query(`ALTER TABLE \`profileHonorHistory\` ADD \`isUpload\` tinyint NOT NULL COMMENT 'แนบไฟล์เอกสาร' DEFAULT 0`);
await queryRunner.query(`ALTER TABLE \`profileHonor\` ADD \`isUpload\` tinyint NOT NULL COMMENT 'แนบไฟล์เอกสาร' DEFAULT 0`);
await queryRunner.query(`ALTER TABLE \`profileDutyHistory\` ADD \`isUpload\` tinyint NOT NULL COMMENT 'แนบไฟล์เอกสาร' DEFAULT 0`);
await queryRunner.query(`ALTER TABLE \`profileDuty\` ADD \`isUpload\` tinyint NOT NULL COMMENT 'แนบไฟล์เอกสาร' DEFAULT 0`);
await queryRunner.query(`ALTER TABLE \`profileAbilityHistory\` ADD \`isUpload\` tinyint NOT NULL COMMENT 'แนบไฟล์เอกสาร' DEFAULT 0`);
await queryRunner.query(`ALTER TABLE \`profileAbility\` ADD \`isUpload\` tinyint NOT NULL COMMENT 'แนบไฟล์เอกสาร' DEFAULT 0`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`profileAbility\` DROP COLUMN \`isUpload\``);
await queryRunner.query(`ALTER TABLE \`profileAbilityHistory\` DROP COLUMN \`isUpload\``);
await queryRunner.query(`ALTER TABLE \`profileDuty\` DROP COLUMN \`isUpload\``);
await queryRunner.query(`ALTER TABLE \`profileDutyHistory\` DROP COLUMN \`isUpload\``);
await queryRunner.query(`ALTER TABLE \`profileHonor\` DROP COLUMN \`isUpload\``);
await queryRunner.query(`ALTER TABLE \`profileHonorHistory\` DROP COLUMN \`isUpload\``);
await queryRunner.query(`ALTER TABLE \`profileInsignia\` DROP COLUMN \`isUpload\``);
await queryRunner.query(`ALTER TABLE \`profileInsigniaHistory\` DROP COLUMN \`isUpload\``);
}
}