CREATE TABLE public.session_schedules
(
    schedule_id integer NOT NULL DEFAULT nextval('session_schedules_schedule_id_seq'::regclass),
    course_id integer NOT NULL,
    title text NOT NULL,
    recurrence jsonb NOT NULL,
    duration_min integer NOT NULL DEFAULT 90,
    participant_roles text[] NOT NULL DEFAULT '{STUDENT,TUTOR}'::text[],
    create_breakout_rooms boolean NOT NULL DEFAULT true,
    advance_hours integer NOT NULL DEFAULT 48,
    notify_hours_before integer NOT NULL DEFAULT 24,
    active boolean NOT NULL DEFAULT true,
    created_by bigint NOT NULL,
    created_at timestamp with time zone NOT NULL DEFAULT now(),
    CONSTRAINT session_schedules_course_id_fkey FOREIGN KEY (course_id) REFERENCES courses(course_id),
    CONSTRAINT session_schedules_created_by_fkey FOREIGN KEY (created_by) REFERENCES partners(partner_id),
    CONSTRAINT session_schedules_pkey PRIMARY KEY (schedule_id)
);
