17 lines · 844 B
-- 2026-10 audit, git transport (GIT-A1, GIT-A8/AZ-A7, GIT-A12).

-- GIT-A8 / AZ-A7: private repositories can only be forked when the owner opts in.
ALTER TABLE repos ADD COLUMN allow_forking INTEGER NOT NULL DEFAULT 0;

-- GIT-A1 / GIT-A8: a private fork whose owner lost access to the parent is detached from the fork
-- network (fork_of_id cleared, hidden refs dropped) and keeps only what it already held.
ALTER TABLE repos ADD COLUMN detached INTEGER NOT NULL DEFAULT 0;

-- GIT-A12: hidden-ref cleanups page through partner repositories across cron runs.
ALTER TABLE hidden_ref_cleanups ADD COLUMN cursor TEXT;

-- GIT-A2: base repositories that hold refs/pull/N/head also need the fetch want check.
UPDATE repos SET bridged_into = 1
 WHERE bridged_into = 0
   AND id IN (SELECT repo_id FROM pull_requests WHERE repo_id != head_repo_id);