CREATE TABLE IF NOT EXISTS repo_protect (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    repo UUID NOT NULL REFERENCES repo(id),
    pattern TEXT NOT NULL,
    require_pull_request BOOLEAN NOT NULL DEFAULT TRUE,
    required_approvals INTEGER NOT NULL DEFAULT 1,
    require_status_checks BOOLEAN NOT NULL DEFAULT FALSE,
    required_status_contexts TEXT NOT NULL DEFAULT '',
    enforce_admins BOOLEAN NOT NULL DEFAULT FALSE,
    allow_force_pushes BOOLEAN NOT NULL DEFAULT FALSE,
    allow_deletions BOOLEAN NOT NULL DEFAULT FALSE,
    created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
    updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
