migrate
This commit is contained in:
parent
8a36a6c977
commit
6fc0c04a9b
4 changed files with 202 additions and 6 deletions
59
src/entities/DevelopmentRisk.ts
Normal file
59
src/entities/DevelopmentRisk.ts
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
import { Entity, Column, ManyToOne, JoinColumn } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { Development } from "./Development";
|
||||
import { Province } from "./Province";
|
||||
|
||||
@Entity("developmentRisk")
|
||||
export class DevelopmentRisk extends EntityBase {
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ประเด็นความเสี่ยง",
|
||||
default: null,
|
||||
})
|
||||
issues: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "โอกาสที่จะเกิด",
|
||||
default: null,
|
||||
})
|
||||
chance: number;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ผลกระทบจากการเกิด",
|
||||
default: null,
|
||||
})
|
||||
effects: number;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ระดับความเสี่ยง",
|
||||
default: null,
|
||||
})
|
||||
riskLevel: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "เเนวทางการบริหารความเสี่ยง",
|
||||
default: null,
|
||||
})
|
||||
riskManagement: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "คีย์นอก(FK)ของตาราง development",
|
||||
default: null,
|
||||
})
|
||||
developmentId: string;
|
||||
|
||||
@ManyToOne(() => Development, (development: Development) => development.developmentRisks)
|
||||
@JoinColumn({ name: "developmentId" })
|
||||
development: Development;
|
||||
}
|
||||
export class CreateDevelopmentRisk {
|
||||
@Column()
|
||||
address: string | null;
|
||||
@Column()
|
||||
provinceId: string;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue