add sort to inspection point

This commit is contained in:
Julian Krauser 2025-05-28 17:13:39 +02:00
parent 2433120e26
commit e404989a28
2 changed files with 5 additions and 1 deletions

View file

@ -1,4 +1,4 @@
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from "typeorm";
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn, Unique } from "typeorm";
import { InspectionPointEnum } from "../../../enums/inspectionEnum";
import { inspectionVersionedPlan } from "./inspectionVersionedPlan";
@ -33,6 +33,9 @@ export class inspectionPoint {
@Column({ type: "int", nullable: true, default: null })
max: number;
@Column({ type: "int", default: 0 })
sort: number;
@Column()
versionedPlanId: string;

View file

@ -64,6 +64,7 @@ export const inspection_point_table = new Table({
{ name: "type", ...getTypeByORM("varchar") },
{ name: "min", ...getTypeByORM("int", true), default: getDefaultByORM("null") },
{ name: "max", ...getTypeByORM("int", true), default: getDefaultByORM("null") },
{ name: "sort", ...getTypeByORM("int"), default: getDefaultByORM("number", 0) },
{ name: "versionedPlanId", ...getTypeByORM("uuid") },
],
foreignKeys: [