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")
id: string;
@ManyToOne(() => TrxMaintenance, { onDelete: "RESTRICT" })
@JoinTable()
maintenance: TrxMaintenance;
@OneToMany(() => TrxMaintenance, (mg) => mg.maintenance_group)
maintenance: TrxMaintenance[];
@Column({
nullable: true,

View File

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