From 30465de07d1981fcb6ef44f63d344cf20d557f30 Mon Sep 17 00:00:00 2001 From: Abdul Rahman Reza Date: Mon, 30 Dec 2024 15:37:15 +0700 Subject: [PATCH] update add branch --- src/entity/log_pull.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/entity/log_pull.ts b/src/entity/log_pull.ts index 87a84ca..1075380 100644 --- a/src/entity/log_pull.ts +++ b/src/entity/log_pull.ts @@ -1,6 +1,7 @@ -import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index, OneToOne, JoinColumn } from 'typeorm'; +import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index, OneToOne, JoinColumn, ManyToOne } from 'typeorm'; import { LogPullType, StatusLogPull } from '../types/pull'; +import { Branch } from './branchs'; @Entity('log_pulls') export class LogPull { @@ -25,6 +26,15 @@ export class LogPull { }) branch_code: string; + @ManyToOne(() => Branch, { onDelete: "RESTRICT" }) + @JoinColumn({ name: 'branch_code' }) + branch: Branch + + @Column({ + nullable: true, + }) + position_date: Date; + @Column({ nullable: true, length: 32