-- Create user_category_settings table
CREATE TABLE IF NOT EXISTS public.user_category_settings (
    user_id UUID NOT NULL REFERENCES public.users(id) ON DELETE CASCADE,
    category_id UUID NOT NULL REFERENCES public.categories(id) ON DELETE CASCADE,
    enabled BOOLEAN NOT NULL DEFAULT true,
    created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
    PRIMARY KEY (user_id, category_id)
);

-- Index for faster lookups by user
CREATE INDEX IF NOT EXISTS idx_user_category_settings_user_id ON public.user_category_settings(user_id);
