remove relation

This commit is contained in:
fadlydev
2025-01-17 15:44:38 +07:00
parent 508f837de9
commit 43080533af
2 changed files with 2 additions and 42 deletions

View File

@ -4,15 +4,9 @@ import {
Column, Column,
CreateDateColumn, CreateDateColumn,
UpdateDateColumn, UpdateDateColumn,
DeleteDateColumn, DeleteDateColumn
ManyToOne,
JoinColumn,
} from 'typeorm'; } from 'typeorm';
import { User } from './users';
import { Department } from './department';
import { Goods } from './goods';
@Entity('asset_realizations') @Entity('asset_realizations')
export class AssetRealization { export class AssetRealization {
@PrimaryGeneratedColumn('uuid') @PrimaryGeneratedColumn('uuid')
@ -30,30 +24,18 @@ export class AssetRealization {
}) })
realization_date: Date; realization_date: Date;
@ManyToOne(() => Goods, (goods) => goods.id, { nullable: false })
@JoinColumn({ name: 'goods_id' })
goods: Goods;
@Column({ @Column({
nullable: false, nullable: false,
type: 'uuid', type: 'uuid',
}) })
goods_id: string; goods_id: string;
@ManyToOne(() => Department, (department) => department.id, { nullable: false })
@JoinColumn({ name: 'department_id' })
department: Department;
@Column({ @Column({
nullable: false, nullable: false,
type: 'uuid', type: 'uuid',
}) })
department_id: string; department_id: string;
@ManyToOne(() => User, (user) => user.id, { nullable: false })
@JoinColumn({ name: 'realized_by' })
realizedBy: User;
@Column({ @Column({
nullable: false, nullable: false,
type: 'uuid', type: 'uuid',

View File

@ -3,24 +3,14 @@ import {
PrimaryGeneratedColumn, PrimaryGeneratedColumn,
Column, Column,
CreateDateColumn, CreateDateColumn,
UpdateDateColumn, UpdateDateColumn
ManyToOne,
JoinColumn,
} from 'typeorm'; } from 'typeorm';
import { User } from './users';
import { RequestOrder } from './request_orders';
import { Goods } from './goods';
@Entity('goods_handover') @Entity('goods_handover')
export class GoodsHandover { export class GoodsHandover {
@PrimaryGeneratedColumn('uuid') @PrimaryGeneratedColumn('uuid')
id: string; id: string;
@ManyToOne(() => RequestOrder, (requestOrder) => requestOrder.id, { nullable: false })
@JoinColumn({ name: 'request_order_id' })
requestOrder: RequestOrder;
@Column({ @Column({
nullable: false, nullable: false,
type: 'uuid', type: 'uuid',
@ -33,30 +23,18 @@ export class GoodsHandover {
}) })
handover_date: Date; handover_date: Date;
@ManyToOne(() => Goods, (goods) => goods.id, { nullable: false })
@JoinColumn({ name: 'goods_id' })
goods: Goods;
@Column({ @Column({
nullable: false, nullable: false,
type: 'uuid', type: 'uuid',
}) })
goods_id: string; goods_id: string;
@ManyToOne(() => User, (user) => user.id, { nullable: false })
@JoinColumn({ name: 'handed_over_by' })
handedOverBy: User;
@Column({ @Column({
nullable: false, nullable: false,
type: 'uuid', type: 'uuid',
}) })
handed_over_by: string; handed_over_by: string;
@ManyToOne(() => User, (user) => user.id, { nullable: false })
@JoinColumn({ name: 'received_by' })
receivedBy: User;
@Column({ @Column({
nullable: false, nullable: false,
type: 'uuid', type: 'uuid',