CREATE TABLE public.session_schedule_exceptions
(
    exception_id integer NOT NULL DEFAULT nextval('session_schedule_exceptions_exception_id_seq'::regclass),
    schedule_id integer NOT NULL,
    occurrence_date date NOT NULL,
    action text NOT NULL,
    new_scheduled_at timestamp with time zone,
    new_title text,
    reason text,
    created_at timestamp with time zone NOT NULL DEFAULT now(),
    CONSTRAINT session_schedule_exceptions_action_check CHECK (action = ANY (ARRAY['SKIP'::text, 'RESCHEDULE'::text])),
    CONSTRAINT session_schedule_exceptions_schedule_id_fkey FOREIGN KEY (schedule_id) REFERENCES session_schedules(schedule_id) ON DELETE CASCADE,
    CONSTRAINT session_schedule_exceptions_pkey PRIMARY KEY (exception_id),
    CONSTRAINT session_schedule_exceptions_schedule_id_occurrence_date_key UNIQUE (schedule_id, occurrence_date)
);
