fix: error undefined on extends class
This commit is contained in:
parent
fefac93e56
commit
2ab0032236
2 changed files with 17 additions and 20 deletions
|
|
@ -2,11 +2,11 @@ import { Entity, Column, ManyToOne, JoinColumn, OneToMany } from "typeorm";
|
|||
import { EntityBase } from "./base/Base";
|
||||
|
||||
import { Profile } from "./Profile";
|
||||
import { ProfileInformationHistory } from "./ProfileInformationHistory";
|
||||
import { BloodGroup } from "./BloodGroup";
|
||||
import { Relationship } from "./Relationship";
|
||||
import { Gender } from "./Gender";
|
||||
@Entity("profileinformation")
|
||||
|
||||
@Entity("profileInformation")
|
||||
export class ProfileInformation extends EntityBase {
|
||||
@Column({
|
||||
nullable: true,
|
||||
|
|
@ -152,3 +152,18 @@ export type UpdateProfileInformation = {
|
|||
relationshipId?: string | null;
|
||||
bloodGroupId?: string | null;
|
||||
};
|
||||
|
||||
@Entity("profileInformationHistory")
|
||||
export class ProfileInformationHistory extends ProfileInformation {
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 40,
|
||||
comment: "คีย์นอก(FK)ของตาราง ProfileInformation",
|
||||
default: null,
|
||||
})
|
||||
profileInformationId: string;
|
||||
|
||||
@ManyToOne(() => ProfileInformation, (v) => v.profileInformationHistory, { onDelete: "CASCADE" })
|
||||
@JoinColumn({ name: "profileInformationId" })
|
||||
profileInformation: ProfileInformation;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,18 +0,0 @@
|
|||
import { Entity, Column, ManyToOne, JoinColumn, OneToMany } from "typeorm";
|
||||
|
||||
import { ProfileInformation } from "./ProfileInformation";
|
||||
|
||||
@Entity("profileinformationHistory")
|
||||
export class ProfileInformationHistory extends ProfileInformation {
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 40,
|
||||
comment: "คีย์นอก(FK)ของตาราง ProfileInformation",
|
||||
default: null,
|
||||
})
|
||||
profileInformationId: string;
|
||||
|
||||
@ManyToOne(() => ProfileInformation, (v) => v.profileInformationHistory, { onDelete: "CASCADE" })
|
||||
@JoinColumn({ name: "profileInformationId" })
|
||||
profileInformation: ProfileInformation;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue