-- Migration: Add is_day_wise column to polls table
-- Run with: psql -d slotfinder -f migrations/add_is_day_wise.sql

DO $$
BEGIN
    IF NOT EXISTS (
        SELECT 1 FROM information_schema.columns
        WHERE table_name = 'polls' AND column_name = 'is_day_wise'
    ) THEN
        ALTER TABLE polls ADD COLUMN is_day_wise BOOLEAN NOT NULL DEFAULT FALSE;
        RAISE NOTICE 'Added is_day_wise column to polls table';
    ELSE
        RAISE NOTICE 'Column is_day_wise already exists';
    END IF;
END $$;
