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