CREATE TABLE IF NOT EXISTS repo_audit_log (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    repo UUID NOT NULL REFERENCES repo(id),
    actor UUID,
    action TEXT NOT NULL,
    target_type TEXT NOT NULL,
    target_id TEXT,
    ip_address TEXT,
    user_agent TEXT,
    metadata TEXT,
    created_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
