Files
lunarfront-app/packages/backend/src/db/migrations/0029_schedule_slots.sql
Ryan Moon f777ce5184 Add lessons Phase 2: schedule slots with conflict detection
Recurring weekly time slots linking instructors to lesson types.
Includes day/time overlap detection, instructor and day-of-week
filtering, and 17 new integration tests (40 total lessons tests).
2026-03-30 09:20:03 -05:00

15 lines
551 B
SQL

-- Phase 2: Schedule slots — recurring weekly time slots
CREATE TABLE "schedule_slot" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid(),
"instructor_id" uuid NOT NULL REFERENCES "instructor"("id"),
"lesson_type_id" uuid NOT NULL REFERENCES "lesson_type"("id"),
"day_of_week" integer NOT NULL,
"start_time" time NOT NULL,
"room" varchar(100),
"max_students" integer NOT NULL DEFAULT 1,
"is_active" boolean NOT NULL DEFAULT true,
"created_at" timestamptz NOT NULL DEFAULT now(),
"updated_at" timestamptz NOT NULL DEFAULT now()
);