update
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index, JoinColumn, ManyToOne } 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";
|
||||
|
||||
@Entity("trx_companies", { schema: "trx" })
|
||||
export class TrxCompany {
|
||||
@ -47,6 +47,9 @@ export class TrxCompany {
|
||||
})
|
||||
pic_email: string;
|
||||
|
||||
@OneToMany(() => TrxCompanyAccount, (company_account) => company_account.company, { cascade: true, nullable: false })
|
||||
company_account: TrxCompanyAccount[];
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@ -21,8 +21,8 @@ export class TrxCompanyAccount {
|
||||
})
|
||||
account_number: string;
|
||||
|
||||
@ManyToOne(() => TrxCompany, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinTable()
|
||||
@ManyToOne(() => TrxCompany, (company) => company.company_account, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
company: TrxCompany;
|
||||
|
||||
@ManyToOne(() => TrxCif, { onDelete: "NO ACTION", nullable: true })
|
||||
|
||||
@ -15,11 +15,11 @@ export class TrxRegistration {
|
||||
})
|
||||
code: string;
|
||||
|
||||
@ManyToOne(() => TrxCompany, { onDelete: "RESTRICT", nullable: true })
|
||||
@ManyToOne(() => TrxCompany, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
company: TrxCompany;
|
||||
|
||||
@ManyToOne(() => TrxCif, { onDelete: "RESTRICT", nullable: true })
|
||||
@ManyToOne(() => TrxCif, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
cif: TrxCif;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user