36 lines
886 B
TypeScript
36 lines
886 B
TypeScript
|
import { Column, Entity, ManyToOne, PrimaryColumn } from "typeorm";
|
||
|
import { member } from "./member";
|
||
|
import { qualification } from "./qualification";
|
||
|
|
||
|
@Entity()
|
||
|
export class memberQualifications {
|
||
|
@PrimaryColumn({ generated: "increment", type: "int" })
|
||
|
id: number;
|
||
|
|
||
|
@Column({ type: "varchar", length: 255, nullable: true })
|
||
|
note?: string;
|
||
|
|
||
|
@Column({ type: "date" })
|
||
|
start: Date;
|
||
|
|
||
|
@Column({ type: "date", nullable: true })
|
||
|
end?: Date;
|
||
|
|
||
|
@Column({ type: "varchar", length: 255, nullable: true })
|
||
|
terminationReason?: string;
|
||
|
|
||
|
@ManyToOne(() => member, (member) => member.awards, {
|
||
|
nullable: false,
|
||
|
onDelete: "CASCADE",
|
||
|
onUpdate: "RESTRICT",
|
||
|
})
|
||
|
member: member;
|
||
|
|
||
|
@ManyToOne(() => qualification, (qualification) => qualification.members, {
|
||
|
nullable: false,
|
||
|
onDelete: "RESTRICT",
|
||
|
onUpdate: "RESTRICT",
|
||
|
})
|
||
|
qualification: qualification;
|
||
|
}
|