CREATE TABLE IF NOT EXISTS repo_webhook (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    repo UUID NOT NULL REFERENCES repo(id),
    url TEXT NOT NULL,
    secret_hash TEXT,
    events TEXT NOT NULL,
    active BOOLEAN NOT NULL DEFAULT TRUE,
    created_by UUID NOT NULL,
    created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
    updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
