-- Create user_settings table for per-user feature flags and preferences
CREATE TABLE IF NOT EXISTS user_settings (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    owner_id UUID NOT NULL,
    key TEXT NOT NULL,
    value JSONB NOT NULL DEFAULT '"false"'::jsonb,
    created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
    updated_at TIMESTAMPTZ NOT NULL DEFAULT now(),
    UNIQUE(owner_id, key)
);
CREATE INDEX idx_user_settings_owner ON user_settings(owner_id);
