Spaces:
Sleeping
Sleeping
| import { | |
| Entity, | |
| PrimaryGeneratedColumn, | |
| Column, | |
| CreateDateColumn, | |
| UpdateDateColumn, | |
| ManyToOne, | |
| OneToMany, | |
| JoinColumn, | |
| } from 'typeorm'; | |
| import type { Relation } from 'typeorm'; | |
| import type { User } from '../../auth/entities/user.entity'; | |
| import type { Course } from '../../courses/entities/course.entity'; | |
| ('course_chat_threads') | |
| export class CourseChatThread { | |
| ('increment', { name: 'thread_id', type: 'bigint', unsigned: true }) | |
| id: number; | |
| ({ name: 'course_id', type: 'bigint', unsigned: true }) | |
| courseId: number; | |
| ({ name: 'created_by', type: 'bigint', unsigned: true }) | |
| createdBy: number; | |
| ({ name: 'title', type: 'varchar', length: 255 }) | |
| title: string; | |
| ({ name: 'description', type: 'text', nullable: true }) | |
| description: string; | |
| ({ name: 'is_pinned', type: 'tinyint', default: 0 }) | |
| isPinned: boolean; | |
| ({ name: 'is_locked', type: 'tinyint', default: 0 }) | |
| isLocked: boolean; | |
| ({ name: 'view_count', type: 'int', default: 0 }) | |
| viewCount: number; | |
| ({ name: 'reply_count', type: 'int', default: 0 }) | |
| replyCount: number; | |
| ({ name: 'created_at' }) | |
| createdAt: Date; | |
| ({ name: 'updated_at' }) | |
| updatedAt: Date; | |
| // Relations | |
| ('ChatMessage', 'thread') | |
| messages: Relation<ChatMessage>[]; | |
| ('Course', { onDelete: 'CASCADE' }) | |
| ({ name: 'course_id' }) | |
| course: Relation<Course>; | |
| ('User', { onDelete: 'CASCADE' }) | |
| ({ name: 'created_by' }) | |
| creator: Relation<User>; | |
| } | |
| import type { ChatMessage } from './chat-message.entity'; | |