update
This commit is contained in:
@ -1,8 +1,9 @@
|
|||||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index, ManyToOne, JoinColumn } from "typeorm";
|
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index, ManyToOne, JoinColumn, OneToMany } from "typeorm";
|
||||||
|
|
||||||
import { Status } from "../../types/status";
|
import { Status } from "../../types/status";
|
||||||
import { HrmsFaculty } from "./hrms_faculty";
|
import { HrmsFaculty } from "./hrms_faculty";
|
||||||
import { HrmsEmployee } from "./hrms_employee";
|
import { HrmsEmployee } from "./hrms_employee";
|
||||||
|
import { HrmsTrainingParticipant } from "./hrms_training_participant";
|
||||||
|
|
||||||
@Entity("hrms_trainings")
|
@Entity("hrms_trainings")
|
||||||
export class HrmsTraining {
|
export class HrmsTraining {
|
||||||
@ -37,6 +38,9 @@ export class HrmsTraining {
|
|||||||
})
|
})
|
||||||
status: Status;
|
status: Status;
|
||||||
|
|
||||||
|
@OneToMany(() => HrmsTrainingParticipant, (participant) => participant.training)
|
||||||
|
training_participant: HrmsTrainingParticipant[];
|
||||||
|
|
||||||
@Column()
|
@Column()
|
||||||
@CreateDateColumn()
|
@CreateDateColumn()
|
||||||
created_at: Date;
|
created_at: Date;
|
||||||
|
|||||||
@ -10,7 +10,7 @@ export class HrmsTrainingParticipant {
|
|||||||
@PrimaryGeneratedColumn("uuid")
|
@PrimaryGeneratedColumn("uuid")
|
||||||
id: string;
|
id: string;
|
||||||
|
|
||||||
@ManyToOne(() => HrmsTraining, { onDelete: "NO ACTION", nullable: false })
|
@ManyToOne(() => HrmsTraining, (training) => training.training_participant, { onDelete: "NO ACTION" })
|
||||||
@JoinColumn()
|
@JoinColumn()
|
||||||
training: HrmsTraining;
|
training: HrmsTraining;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user