-- Add release_date column for calendar view
ALTER TABLE media ADD COLUMN IF NOT EXISTS release_date TIMESTAMPTZ;

-- Partial index for efficient calendar range queries on monitored, non-deleted items
CREATE INDEX IF NOT EXISTS idx_media_release_date_monitored
    ON media (release_date)
    WHERE release_date IS NOT NULL AND monitored = true AND deleted_at IS NULL;
