docs: migration headers keep the before and after, without ids, quotes or one library's numbers (#6277)
release / govulncheck (push) Successful in 17s
release / web (push) Successful in 1m33s
release / go (push) Successful in 1m49s
release / integration (push) Successful in 5m42s
release / android (push) Successful in 5m59s
release / Build signed APK (releases and dev) (push) Successful in 6m9s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 16s
release / Verify release artifacts (tag releases only) (push) Skipped

Applies rule 32's migration exception: each header still says what the
schema was, what changes and what it prevents, but task, milestone,
decision and rule ids are replaced by the practice they stood for, the
operator quotes by the decision, single-install counts are dropped, and
pointers to a deleted package and an external design doc are gone.
golang-migrate keeps no checksum, so editing applied migrations'
comments is safe.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-23 12:34:39 -04:00
co-authored by Claude Opus 5.5
parent 1d4ef1a23f
commit 6028d78844
93 changed files with 301 additions and 338 deletions
@@ -1,30 +1,30 @@
-- 0075_duplicate_resolve.up.sql — duplicates resolve themselves (Scribe
-- milestone #498: #5435, #5436, #5437).
-- 0075_duplicate_resolve.up.sql — duplicates resolve themselves.
--
-- The sweep (0059) proposes groups and, until now, every proposal waited for the
-- operator. The resolver classifies each pending group and acts on the classes
-- that are safe. What makes deletion safe is Lidarr's view of the file: Lidarr
-- maps one file to each track of the release it monitors, so deleting a mapped
-- file opens a hole it fills by downloading again. Only a copy Lidarr does not
-- map may go.
-- Before: the sweep (0059) proposed groups and every proposal waited for an
-- admin. After: the resolver classifies each pending group and acts on the
-- classes that are safe. What makes deletion safe is Lidarr's view of the file:
-- Lidarr maps one file to each track of the release it monitors, so deleting a
-- mapped file opens a hole it fills by downloading again. Only a copy Lidarr
-- does not map may go.
-- What kind of duplicate a group is. NULL until the resolver has classified it.
-- same_release every copy is on one album
-- cross_release the same song on different releases (a single and its album)
-- mismatch identical audio under different titles on different albums:
-- a file imported as the wrong song
-- review anything else: the operator decides
-- Rule 36: a new value swaps this constraint in the same migration.
-- review anything else: an admin decides
-- A new value swaps this constraint in the same migration.
ALTER TABLE duplicate_groups ADD COLUMN class text;
ALTER TABLE duplicate_groups ADD CONSTRAINT duplicate_groups_class_check
CHECK (class IN ('same_release', 'cross_release', 'mismatch', 'review'));
-- Why the resolver left a group for the operator, in words the report shows
-- ("Lidarr tracks every copy as its own track"). NULL when it had nothing to say.
-- Why the resolver left a group for an admin, in words the report shows
-- ("Lidarr tracks every copy as its own track"). NULL when it had nothing to
-- say.
ALTER TABLE duplicate_groups ADD COLUMN resolve_note text;
-- True when the resolver merged the group itself, so the report can tell its
-- merges from the operator's.
-- merges from an admin's.
ALTER TABLE duplicate_groups ADD COLUMN resolved_automatically boolean NOT NULL DEFAULT false;
-- Lidarr's view of each copy, as of the resolver's last pass:
@@ -36,12 +36,12 @@ ALTER TABLE duplicate_group_members ADD COLUMN lidarr_state text;
ALTER TABLE duplicate_group_members ADD CONSTRAINT duplicate_group_members_lidarr_state_check
CHECK (lidarr_state IN ('tracked', 'unmapped'));
-- Rule 25: the operator can turn the resolver off. On by default: the operator
-- asked for duplicates to resolve themselves (2026-10-09).
-- An admin can turn the resolver off. On by default: duplicates are meant to
-- resolve themselves.
ALTER TABLE fingerprint_settings ADD COLUMN auto_resolve boolean NOT NULL DEFAULT true;
-- The resolver tells admins what it did (rule 36: the kind CHECKs of 0073 are
-- swapped to carry the new value). Postgres named both from their columns.
-- The resolver tells admins what it did (the kind CHECKs of 0073 are swapped
-- to carry the new value). Postgres named both from their columns.
ALTER TABLE user_notifications DROP CONSTRAINT user_notifications_kind_check;
ALTER TABLE user_notifications ADD CONSTRAINT user_notifications_kind_check
CHECK (kind IN ('request_approved', 'request_rejected', 'request_completed',