From 1305dbf89e788197b602fccca6b6c7af5bb9bb41 Mon Sep 17 00:00:00 2001 From: fadlydev Date: Thu, 9 Jan 2025 14:22:49 +0700 Subject: [PATCH] update relation from request order with goods id --- src/entity/request_orders.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/entity/request_orders.ts b/src/entity/request_orders.ts index b362958..f1d9333 100644 --- a/src/entity/request_orders.ts +++ b/src/entity/request_orders.ts @@ -8,12 +8,10 @@ import { Index, ManyToOne, JoinColumn, - OneToMany, } from 'typeorm'; import { User } from './users'; import { Supplier } from './supplier'; -import { Goods } from './goods'; export enum PurchasingMethod { PO = 'PO', // Purchase Order @@ -66,9 +64,12 @@ export class RequestOrder { }) requested_by: string; - @OneToMany(() => Goods, (goods) => goods.id, { nullable: false }) - @JoinColumn({ name: 'goods_ids' }) - goods: Goods[]; + @Column({ + nullable: false, + type: 'uuid', + array: true, + }) + goods_ids: string[]; @Column({ nullable: true,