Files
multica/server/migrations/468_drop_reference_only_column.down.sql
Bohan Jiang 023c349f5f MUL-7072 chore(db): drop the reference_only column (#8253)
Contract half of the pair #8245 started, now that #8245 is live everywhere: since that release a bare body mention of an issue key writes no link row, and no query reads or writes the column.

Migration 468 deletes any reference_only rows an instance of the older release could still have written during #8245's rollout — once the column is gone such a row would be indistinguishable from a real link, visible in the issue's PR list and blocking auto-advance while its PR is open — and then drops the column from issue_pull_request and issue_vcs_pull_request. sqlc drops the two phantom struct fields with it.

The down migration re-adds the column so a pre-#8245 instance can run against a rolled-back schema; the deleted rows do not come back and no read path has returned them since #8245.
2026-09-13 19:12:34 +08:00

12 lines
615 B
SQL

-- Re-add the column so an instance of the release before MUL-7072 can run against
-- a rolled-back schema: that code lists reference_only in its link INSERT, and
-- the default matches what it wrote for a claimed key.
--
-- The rows the up migration deleted do not come back. They recorded only "this PR
-- body mentioned this key", which the PR body itself still says, and no read path
-- has returned them since MUL-7072.
ALTER TABLE issue_pull_request
ADD COLUMN reference_only BOOLEAN NOT NULL DEFAULT FALSE;
ALTER TABLE issue_vcs_pull_request
ADD COLUMN reference_only BOOLEAN NOT NULL DEFAULT FALSE;