feat: add department_id to all business entities

This commit is contained in:
2026-07-05 23:45:05 +08:00
parent 7d945029eb
commit ad24c9ef23
13 changed files with 122 additions and 2 deletions

View File

@@ -10,6 +10,7 @@ import {
} from 'typeorm';
import { Classroom } from './classroom.entity';
import { Tenant } from './tenant.entity';
import { Department } from './department.entity';
@Entity('classroom_rentals')
@Index(['classroomId', 'startDate', 'endDate'])
@@ -64,4 +65,11 @@ export class ClassroomRental {
@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;
}