ALTER TABLE staff_work_sessions ADD COLUMN source_event_ids JSONB NOT NULL DEFAULT '[]'::jsonb, ADD COLUMN auto_closed BOOLEAN NOT NULL DEFAULT FALSE, ADD CONSTRAINT staff_work_sessions_source_events_array CHECK (jsonb_typeof(source_event_ids) = 'array'); COMMENT ON COLUMN staff_work_sessions.source_event_ids IS 'Immutable attendance event ids used to derive the latest session revision.'; COMMENT ON COLUMN staff_work_sessions.auto_closed IS 'True when a scheduler cutoff supplied the end time; manager confirmation is still required.';