refactor: changed the project structure
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { BaseEntity } from "src/common/entities/base.entity";
|
||||
import { Column, Entity, JoinColumn, ManyToOne, OneToOne } from "typeorm";
|
||||
import { Reply } from "./reply.entity";
|
||||
import { Attachment } from "src/modules/attachment/entities/attachment.entity";
|
||||
|
||||
@Entity('reply_attachments')
|
||||
export class ReplyAttachment extends BaseEntity {
|
||||
@ManyToOne(() => Reply, (rp) => rp.attachments, {
|
||||
onDelete: 'CASCADE'
|
||||
})
|
||||
reply: Reply;
|
||||
|
||||
@OneToOne(() => Attachment, (attch) => attch.reply, {
|
||||
cascade: true,
|
||||
onDelete: 'CASCADE'
|
||||
})
|
||||
@JoinColumn()
|
||||
attachment: Attachment;
|
||||
}
|
||||
Reference in New Issue
Block a user