migatation and get tab4

This commit is contained in:
AdisakKanthawilang 2024-08-08 10:39:44 +07:00
parent b9cc922edc
commit 3056dfeb2a
3 changed files with 57 additions and 46 deletions

View file

@ -17,6 +17,7 @@ import { StrategyChild3 } from "./StrategyChild3";
import { StrategyChild2 } from "./StrategyChild2";
import { StrategyChild1 } from "./StrategyChild1";
import { DevelopmentRisk } from "./DevelopmentRisk";
import { DevelopmentOther } from "./DevelopmentOther";
@Entity("development")
export class Development extends EntityBase {
@ -194,6 +195,12 @@ export class Development extends EntityBase {
)
developmentRisks: DevelopmentRisk[];
@OneToMany(
() => DevelopmentOther,
(developmentOther: DevelopmentOther) => developmentOther.development,
)
developmentOthers: DevelopmentOther[];
@OneToMany(
() => DevelopmentProjectType,
(developmentProjectType: DevelopmentProjectType) => developmentProjectType.development,

View file

@ -0,0 +1,48 @@
import { Entity, Column, ManyToOne, JoinColumn } from "typeorm";
import { EntityBase } from "./base/Base";
import { Development } from "./Development";
import { Province } from "./Province";
@Entity("developmentOther")
export class DevelopmentOther extends EntityBase {
@Column({
nullable: true,
comment: "หัวข้อ/ประเด็นการฝึกอบรม ศึกษาดูงาน",
default: null,
})
topicAcademic: string;
@Column({
nullable: true,
comment: "สถานที่ฝึกอบรม ศึกษาดูงาน",
default: null,
})
addressAcademic: string;
@Column({
nullable: true,
comment: "จังหวัด(ข้อมูลวิชาการ)",
default: null,
})
provinceActualId: string;
@Column({
nullable: true,
comment: "คีย์นอก(FK)ของตาราง development",
default: null,
})
developmentId: string;
@ManyToOne(() => Development, (development: Development) => development.developmentOthers)
@JoinColumn({ name: "developmentId" })
development: Development;
}
export class UpdateDevelopmentOther {
@Column()
topicAcademic: string | null;
@Column()
addressAcademic: number | null;
@Column()
provinceActualId: number | null;
}