-- Add secrets table for edge functions
CREATE TABLE IF NOT EXISTS functions.secrets (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    name TEXT NOT NULL,
    value TEXT NOT NULL,
    project_ref TEXT NOT NULL,
    created_at TIMESTAMPTZ DEFAULT now(),
    UNIQUE(project_ref, name)
);

-- Index for faster lookup by project
CREATE INDEX idx_functions_secrets_project ON functions.secrets(project_ref);
