import { Entity, Column, ManyToOne, JoinColumn, OneToMany } from "typeorm"; import { EntityBase } from "./base/Base"; import { ProfileFamilyFather } from "./ProfileFamilyFather"; @Entity("profileFamilyFatherHistory") export class ProfileFamilyFatherHistory extends EntityBase { @Column({ nullable: true, default: null, comment: "คำนำหน้าบิดา", }) fatherPrefix: string; @Column({ nullable: true, default: null, comment: "ชื่อบิดา", }) fatherFirstName: string; @Column({ nullable: true, default: null, comment: "นามสกุลบิดา", }) fatherLastName: string; @Column({ nullable: true, default: null, comment: "อาชีพบิดา", }) fatherCareer: string; @Column({ nullable: true, default: null, comment: "เลขที่บัตรประชาชนบิดา", }) fatherCitizenId: string; @Column({ nullable: true, default: null, comment: "มีชีวิตบิดา", }) fatherLive: boolean; @Column({ nullable: true, length: 40, comment: "คีย์นอก(FK)ของตาราง ProfileFamilyFather", default: null, }) profileFamilyFatherId: string; @ManyToOne(() => ProfileFamilyFather, (v) => v.histories) @JoinColumn({ name: "profileFamilyFatherId" }) profileFamilyFather: ProfileFamilyFather; }