This commit is contained in:
2025-11-28 14:17:34 +07:00
parent f8b6bbd0a1
commit 8d56645f3b
2 changed files with 5 additions and 5 deletions

View File

@ -8,9 +8,8 @@ export class TrxMaintenanceGroup {
@PrimaryGeneratedColumn("uuid") @PrimaryGeneratedColumn("uuid")
id: string; id: string;
@ManyToOne(() => TrxMaintenance, { onDelete: "RESTRICT" }) @OneToMany(() => TrxMaintenance, (mg) => mg.maintenance_group)
@JoinTable() maintenance: TrxMaintenance[];
maintenance: TrxMaintenance;
@Column({ @Column({
nullable: true, nullable: true,

View File

@ -15,8 +15,9 @@ export class TrxMaintenance {
}) })
code: string; code: string;
@OneToMany(() => TrxMaintenanceGroup, (mg) => mg.maintenance) @ManyToOne(() => TrxMaintenanceGroup, { onDelete: "NO ACTION" })
maintenance_groups: TrxMaintenanceGroup[]; @JoinTable()
maintenance_group: TrxMaintenanceGroup;
@ManyToOne(() => TrxCustomer, { onDelete: "RESTRICT" }) @ManyToOne(() => TrxCustomer, { onDelete: "RESTRICT" })
@JoinTable() @JoinTable()