This commit is contained in:
2025-10-02 13:40:05 +07:00
parent abdb58e491
commit ec0ebd02ee
2 changed files with 3 additions and 7 deletions

View File

@ -1,7 +1,6 @@
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index, JoinColumn, ManyToOne, OneToMany, OneToOne } from "typeorm";
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index, JoinColumn, ManyToOne, OneToMany } from "typeorm";
import { Status } from "../types/status";
import { TrxCompanyAccount } from "./trx_company_accounts";
import { TrxCompanyUser } from "./trx_company_users";
@Entity("trx_companies", { schema: "trx" })
export class TrxCompany {
@ -51,9 +50,6 @@ export class TrxCompany {
@OneToMany(() => TrxCompanyAccount, (company_account) => company_account.company, { cascade: true, nullable: false })
company_account: TrxCompanyAccount[];
@OneToOne(() => TrxCompanyUser, (company_user) => company_user.company, { onDelete: "CASCADE" })
user: TrxCompanyUser;
@Column()
@CreateDateColumn()
created_at: Date;

View File

@ -48,8 +48,8 @@ export class TrxCompanyUser {
@OneToMany(() => TrxConfigLevel, (level) => level.id, { onDelete: "NO ACTION", nullable: false })
level: TrxConfigLevel[];
@OneToOne(() => TrxCompany, (company) => company.user, { cascade: true })
@JoinColumn()
@ManyToOne(() => TrxCompany, { onDelete: "NO ACTION" })
@JoinTable()
company: TrxCompany;
@Index()