-- Add time slot support to blocked_dates table
-- This allows blocking specific hours instead of full days

-- Remove unique constraint on blocked_date to allow multiple time slots per day
DROP INDEX IF EXISTS idx_blocked_dates_date;

-- Add start_time and end_time columns
ALTER TABLE blocked_dates ADD COLUMN start_time TEXT;
ALTER TABLE blocked_dates ADD COLUMN end_time TEXT;

-- Create new composite index for date and time range lookups
CREATE INDEX IF NOT EXISTS idx_blocked_dates_datetime ON blocked_dates(blocked_date, start_time, end_time);

-- Note: NULL start_time and end_time means full day is blocked
-- Non-NULL values mean only that specific time slot is blocked
