Spaces:
Sleeping
Sleeping
| from sqlalchemy import Table, Column, String, ForeignKey, Index | |
| from app.db.database import Base | |
| # Pure association table — no ORM class needed | |
| student_batch_table = Table( | |
| "student_batch", | |
| Base.metadata, | |
| Column("student_id", String(36), ForeignKey("students.id", ondelete="CASCADE"), primary_key=True), | |
| Column("batch_id", String(36), ForeignKey("batches.id", ondelete="CASCADE"), primary_key=True), | |
| Index("ix_student_batch_batch_id", "batch_id"), | |
| ) | |