Skip to content

Decides the location table is opt-in (ADR-0002 Amendment) - #139

Merged
johnnyt merged 1 commit into
mainfrom
sr-xgi8-locations-opt-in-record
Sep 30, 2026
Merged

johnnyt merged 1 commit into
mainfrom
sr-xgi8-locations-opt-in-record

Conversation

@johnnyt

@johnnyt johnnyt commented Sep 30, 2026

Copy link
Copy Markdown
Member

Adds a second Amendment at proposed to ADR-0002 (addressing): "Amendment (2026-09-30, sr-xgi8): the location table is opt-in, outside the version walk". It decides how a host runs V04, the BasicHTTP location table, which the earlier Amendment of 2026-09-30 created without saying how a host runs it. This repo's rule is that the record lands before the code, so this PR carries the record alone. The code PR (138) is rebased onto it afterwards and cites it.

What it decides:

  • V04 is outside the walk that from: and version: span, so StatifierRouter.Migrations.up/1 and down/1 answer as before for every database. A host that never sets :basichttp sees no change.
  • A host that sets the key runs StatifierRouter.Migrations.up_locations/1 and down_locations/1 in a later migration of its own. They take the storage options, the layout options and :primary_key.
  • They refuse :from, :version, any other key, and a leading column named like one of the location table's own columns.
  • Both are tolerant: up_locations/1 creates only what is missing, and down_locations/1 drops the table only if it is there.
  • The rollback order: the opt-in migration rolls back before V01's tables go.
  • It amends in part the earlier Amendment's four migration sentences, each quoted by its bullet anchor: "Where it is stored", "Why a table and not a column on the address row", "Absent is today" and "Where the code is".

Gate. This is a docs-only change under docs/adr/. It touches no gated path (lib/, test/, config/, mix.exs, mix.lock, corpus/, README.md), so there is no local gate to run. CI runs regardless. No changelog fragment: ADRs are on changelog.d/README.md's "do not" side.

Direction check (in-turn). Each claim was checked against main at 8600d6f:

  • The earlier Amendment's four quoted sentences are verbatim at the anchors named.
  • The sr-3o5z Amendment's "Only the tables the call creates" is the bullet that says the set "is taken from the versions from: and version: walk".
  • StatifierRouter.Migrations' private @migrations maps versions 1 to 3.
  • test/statifier_router/migrations_test.exs asserts that up(version: 4) raises "unknown migration version 4".

The two new functions and V04's tolerant down/1 are cited only as the pull request that implements this record, as the earlier Amendment cites its code. git diff origin/main -- docs/adr/ shows zero removed lines.

Adds a second Amendment at proposed to ADR-0002: V04, the BasicHTTP
location table, stays outside the version walk that from: and version:
span, so up/1 and down/1 answer as before for every database. A host
that sets :basichttp runs Migrations.up_locations/1 and
down_locations/1 in a later migration of its own; their options,
refusals, tolerance and rollback order are decided here. Amends the
earlier Amendment's migration sentences in part.

Refs: sr-xgi8
@johnnyt
johnnyt merged commit 2de121b into main Sep 30, 2026
1 check passed
@johnnyt
johnnyt deleted the sr-xgi8-locations-opt-in-record branch September 30, 2026 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant