ALTER TABLE public.attendance ADD COLUMN IF NOT EXISTS shift TEXT;
ALTER TABLE public.attendance DROP CONSTRAINT IF EXISTS attendance_shift_check;
ALTER TABLE public.attendance ADD CONSTRAINT attendance_shift_check CHECK (shift IS NULL OR shift IN ('A','B','C','custom'));
CREATE INDEX IF NOT EXISTS idx_attendance_shift ON public.attendance(shift);