feat: add department_id to all business entities
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
||||
} from 'typeorm';
|
||||
import { Student } from './student.entity';
|
||||
import { Class } from './class.entity';
|
||||
import { Department } from './department.entity';
|
||||
|
||||
@Entity('attendance_records')
|
||||
@Index(['classId', 'attendanceDate'])
|
||||
@@ -52,4 +53,11 @@ export class AttendanceRecord {
|
||||
|
||||
@UpdateDateColumn({ name: 'updated_at' })
|
||||
updatedAt: Date;
|
||||
|
||||
@Column({ name: 'department_id', type: 'integer', nullable: true })
|
||||
departmentId: number;
|
||||
|
||||
@ManyToOne(() => Department, { nullable: true })
|
||||
@JoinColumn({ name: 'department_id' })
|
||||
department: Department;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user