mirror of
https://github.com/MrSedan/neuro-reply-website.git
synced 2026-01-14 20:49:42 +03:00
Changed foreign column
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { Column, Entity, JoinColumn, OneToMany, OneToOne, PrimaryGeneratedColumn } from 'typeorm';
|
import { Column, Entity, JoinColumn, ManyToOne, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
|
||||||
import { Admin } from './admin.entity';
|
import { Admin } from './admin.entity';
|
||||||
import { Image } from './image.entity';
|
import { Image } from './image.entity';
|
||||||
@Entity()
|
@Entity()
|
||||||
@@ -25,8 +25,8 @@ export class Post {
|
|||||||
@Column({ nullable: false })
|
@Column({ nullable: false })
|
||||||
public from_user_id!: string;
|
public from_user_id!: string;
|
||||||
|
|
||||||
@OneToOne(() => Admin, (admin) => admin.user.id)
|
@ManyToOne(() => Admin, (admin) => admin.user.id)
|
||||||
@JoinColumn({ name: 'from_user_id' })
|
@JoinColumn({ name: 'from_user_id', referencedColumnName: 'user_id' })
|
||||||
public from_user!: Admin;
|
public from_user!: Admin;
|
||||||
|
|
||||||
@OneToMany(() => Image, (image) => image.post)
|
@OneToMany(() => Image, (image) => image.post)
|
||||||
|
|||||||
Reference in New Issue
Block a user