db schema connects

This commit is contained in:
Julian Krauser 2025-05-28 17:06:45 +02:00
parent baa3b2cc8c
commit 8c81c8f336
7 changed files with 33 additions and 2 deletions

View file

@ -2,6 +2,7 @@ import { Column, ColumnType, Entity, ManyToOne, OneToMany, PrimaryGeneratedColum
import { getTypeByORM } from "../../../migrations/ormHelper";
import { equipmentType } from "./equipmentType";
import { damageReport } from "../damageReport";
import { inspection } from "../inspection/inspection";
@Entity()
export class equipment {
@ -35,4 +36,7 @@ export class equipment {
@OneToMany(() => damageReport, (d) => d.equipment, { cascade: ["insert"] })
reports: damageReport[];
@OneToMany(() => inspection, (i) => i.equipment)
inspections: inspection[];
}

View file

@ -1,5 +1,6 @@
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from "typeorm";
import { equipment } from "./equipment";
import { inspectionPlan } from "../inspection/inspectionPlan";
@Entity()
export class equipmentType {
@ -15,5 +16,6 @@ export class equipmentType {
@OneToMany(() => equipment, (e) => e.equipmentType, { cascade: ["insert"] })
equipment: equipment[];
inspectionPlans: Array<any>;
@OneToMany(() => inspectionPlan, (ip) => ip.equipment)
inspectionPlans: inspectionPlan[];
}