Spaces:
Sleeping
Sleeping
| import { | |
| Entity, | |
| Column, | |
| PrimaryGeneratedColumn, | |
| CreateDateColumn, | |
| ManyToOne, | |
| JoinColumn, | |
| Index, | |
| } from 'typeorm'; | |
| import { User } from './user.entity'; | |
| import { Course } from './course.entity'; | |
| ('user_courses') | |
| (['userId', 'courseId'], { unique: true }) | |
| export class UserCourse { | |
| () | |
| id: number; | |
| ({ name: 'user_id' }) | |
| userId: number; | |
| ({ name: 'course_id' }) | |
| courseId: number; | |
| ({ type: 'varchar', length: 64, unique: true, name: 'access_token' }) | |
| accessToken: string; | |
| ({ type: 'datetime', name: 'expired_at' }) | |
| expiredAt: Date; | |
| ({ name: 'created_at' }) | |
| createdAt: Date; | |
| (() => User, (user) => user.userCourses) | |
| ({ name: 'user_id' }) | |
| user: User; | |
| (() => Course, (course) => course.userCourses) | |
| ({ name: 'course_id' }) | |
| course: Course; | |
| } | |