CREATE TABLE IF NOT EXISTS app_settings (
    key VARCHAR(100) PRIMARY KEY,
    value TEXT,
    category VARCHAR(50),
    updated_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
);

-- Insert some default keys so they show up in the UI
INSERT INTO app_settings (key, value, category) VALUES 
    ('icici_merchant_id', '', 'payments'),
    ('icici_api_key', '', 'payments'),
    ('google_safe_browsing_key', '', 'security'),
    ('google_client_id', '', 'auth'),
    ('apple_service_id', '', 'auth')
ON CONFLICT (key) DO NOTHING;
