refactor: replace UserDingMapping with StudentDingMapping entity
This commit is contained in:
24
apps/server/src/entities/student-ding-mapping.entity.ts
Normal file
24
apps/server/src/entities/student-ding-mapping.entity.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import {
|
||||
Entity, PrimaryGeneratedColumn, Column, CreateDateColumn,
|
||||
ManyToOne, JoinColumn,
|
||||
} from 'typeorm';
|
||||
import { Student } from './student.entity';
|
||||
|
||||
@Entity('student_ding_mapping')
|
||||
export class StudentDingMapping {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
|
||||
@Column({ name: 'ding_user_id', length: 100, unique: true })
|
||||
dingUserId: string;
|
||||
|
||||
@Column({ name: 'student_id', type: 'integer', unique: true })
|
||||
studentId: number;
|
||||
|
||||
@ManyToOne(() => Student, { onDelete: 'CASCADE' })
|
||||
@JoinColumn({ name: 'student_id' })
|
||||
student: Student;
|
||||
|
||||
@CreateDateColumn({ name: 'created_at' })
|
||||
createdAt: Date;
|
||||
}
|
||||
Reference in New Issue
Block a user