Spaces:
Sleeping
Sleeping
| import { | |
| Entity, | |
| Column, | |
| PrimaryGeneratedColumn, | |
| CreateDateColumn, | |
| UpdateDateColumn, | |
| ManyToOne, | |
| JoinColumn, | |
| OneToMany, | |
| } from 'typeorm'; | |
| import { User } from './user.entity'; | |
| import { Course } from './course.entity'; | |
| ('comments') | |
| export class Comment { | |
| () | |
| id: number; | |
| ({ name: 'course_id' }) | |
| courseId: number; | |
| ({ name: 'user_id' }) | |
| userId: number; | |
| ({ name: 'parent_id', nullable: true }) | |
| parentId: number; | |
| ({ name: 'reply_to_comment_id', nullable: true }) | |
| replyToCommentId: number; | |
| ({ type: 'text' }) | |
| content: string; | |
| ({ name: 'created_at' }) | |
| createdAt: Date; | |
| ({ name: 'updated_at' }) | |
| updatedAt: Date; | |
| (() => User, (user) => user.comments) | |
| ({ name: 'user_id' }) | |
| user: User; | |
| (() => Course, (course) => course.comments) | |
| ({ name: 'course_id' }) | |
| course: Course; | |
| (() => Comment, (comment) => comment.replies) | |
| ({ name: 'parent_id' }) | |
| parent: Comment; | |
| (() => Comment) | |
| ({ name: 'reply_to_comment_id' }) | |
| replyToComment: Comment; | |
| (() => Comment, (comment) => comment.parent) | |
| replies: Comment[]; | |
| } | |