update
This commit is contained in:
@ -1,8 +1,9 @@
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinTable, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, JoinTable, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
||||
import { Status } from "../types/status";
|
||||
import { TrxCustomerPosition, TrxCustomerStatus, TrxCustomerType, TrxIdentityType } from "../types/trx";
|
||||
import { TrxOccupation } from "./trx_occupations";
|
||||
import { TrxCountry } from "./trx_countries";
|
||||
import { TrxMaintenanceGroup } from "./trx_maintenance_groups";
|
||||
|
||||
@Entity("trx_customers", { schema: "trx" })
|
||||
export class TrxCustomer {
|
||||
@ -129,6 +130,10 @@ export class TrxCustomer {
|
||||
@JoinTable()
|
||||
country: TrxCountry;
|
||||
|
||||
@ManyToOne(() => TrxMaintenanceGroup, (group) => group.customer, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
maintenance_group: TrxMaintenanceGroup;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 256,
|
||||
|
||||
@ -10,7 +10,7 @@ export class TrxMaintenanceGroup {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@OneToMany(() => TrxCustomer, (customer) => customer.id)
|
||||
@OneToMany(() => TrxCustomer, (customer) => customer.maintenance_group)
|
||||
customer: TrxCustomer[];
|
||||
|
||||
@Column({
|
||||
|
||||
Reference in New Issue
Block a user