This commit is contained in:
2025-10-01 03:06:53 +07:00
parent da0dd2c627
commit b81120319c
2 changed files with 6 additions and 1 deletions

View File

@ -45,7 +45,7 @@ export class TrxCompanyUser {
})
name: string;
@OneToMany(() => TrxConfigLevel, (level) => level.id, { onDelete: "NO ACTION" })
@OneToMany(() => TrxConfigLevel, (level) => level.company_user, { onDelete: "NO ACTION", nullable: false })
level: TrxConfigLevel[];
@ManyToOne(() => TrxCompany, { onDelete: "NO ACTION" })

View File

@ -1,11 +1,16 @@
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index, JoinColumn, ManyToOne } from "typeorm";
import { Status } from "../types/status";
import { TrxCompanyUser } from "./trx_company_users";
@Entity("trx_config_levels", { schema: "trx" })
export class TrxConfigLevel {
@PrimaryGeneratedColumn("uuid")
id: string;
@ManyToOne(() => TrxCompanyUser, (company) => company.level, { onDelete: "NO ACTION" })
@JoinColumn()
company_user: TrxCompanyUser;
@Column({
nullable: true,
length: 256,