|
|
@@ -1,4 +1,4 @@
|
|
|
-import { Entity, PrimaryGeneratedColumn, Column, Index, ForeignKey, OneToMany, ManyToOne } from 'typeorm';
|
|
|
+import { Entity, PrimaryGeneratedColumn, Column, Index, ForeignKey, OneToMany, ManyToOne, JoinColumn } from 'typeorm';
|
|
|
import { HetongRenew } from './hetong-renew.entity';
|
|
|
import { Client } from '../clients/client.entity';
|
|
|
import { z } from '@hono/zod-openapi';
|
|
|
@@ -15,9 +15,10 @@ export class Hetong {
|
|
|
userId!: string;
|
|
|
|
|
|
@Column({ name: 'client_id', type: 'int', unsigned: true })
|
|
|
- @ForeignKey(() => Client)
|
|
|
clientId!: number;
|
|
|
+
|
|
|
@ManyToOne(() => Client)
|
|
|
+ @JoinColumn({ name: 'client_id' })
|
|
|
client!: Client;
|
|
|
|
|
|
@Column({ name: 'project_id', type: 'varchar', length: 50, nullable: true })
|