Skip to content

feat(store): version migration ledger entries - #758

Open
rodboev wants to merge 8 commits into
kenn-io:mainfrom
rodboev:pr/316-migration-ledger-versioning
Open

feat(store): version migration ledger entries#758
rodboev wants to merge 8 commits into
kenn-io:mainfrom
rodboev:pr/316-migration-ledger-versioning

Conversation

@rodboev

@rodboev rodboev commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

The migration ledger now stores the highest successfully applied version for each migration name. Migration gates can request a minimum version while existing name-only callers default to version 1. Legacy ledger rows are preserved, and the version column is added to both schema mirrors.

The ledger previously treated any row with a matching name as complete, so a reshaped migration needed a new _v2 name even when its logical identity was unchanged. A monotonic version column adds the missing distinction while retaining one row per migration and the existing success-only lifecycle. No usage change.

Closes #316

@roborev-ci

roborev-ci Bot commented Sep 3, 2026

Copy link
Copy Markdown

roborev: Combined Review (e467efa)

Verdict: One Medium-or-higher finding identified.

No Medium, High, or Critical findings were reported.


Reviewers: 2 done | Synthesis: codex, 6s | Total: 8m16s

@roborev-ci

roborev-ci Bot commented Sep 3, 2026

Copy link
Copy Markdown

roborev: Combined Review (d187403)

No issues found.


Reviewers: 2 done | Synthesis: codex | Total: 4m38s

@roborev-ci

roborev-ci Bot commented Sep 4, 2026

Copy link
Copy Markdown

roborev: Combined Review (d31b7ec)

No issues found.


Reviewers: 2 done | Synthesis: codex | Total: 5m20s

@wesm wesm self-assigned this Sep 6, 2026
Require one version in context-aware ledger calls and migration gates so
the compiler rejects extra arguments. Keep name-only callers at version 1
and validate each gate's version once before running migration work.

Prepare the ledger column directly before its first query. Looking up and
skipping a legacy migration by description made startup ordering depend
on a display label. The dedicated ALTER keeps that ordering explicit.

Exercise the name-only store writer when checking that an older version
cannot replace a newer one, instead of repeating SQL inside the test.

Generated with Codex (GPT-6)
Co-authored-by: Codex <noreply@openai.com>
@roborev-ci

roborev-ci Bot commented Sep 6, 2026

Copy link
Copy Markdown

roborev: Combined Review (f06796d)

No issues found.


Reviewers: 2 done | Synthesis: codex | Total: 5m2s

CI builds the pull request merged with main. The directory projection
and sync resume migrations were added there after this branch diverged,
so they still called runOnceMigration without the new version argument.
That broke every build importing the store package despite the branch
passing its local checks.

Merge main and request version 1 at both gates. This keeps their existing
behavior and lets the combined tree use the explicit version API.

Generated with Codex (GPT-6)
Co-authored-by: Codex <noreply@openai.com>
@roborev-ci

roborev-ci Bot commented Sep 6, 2026

Copy link
Copy Markdown

roborev: Combined Review (f12c8c4)

No issues found.


Reviewers: 2 done | Synthesis: codex | Total: 4m29s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

store/migrations: add per-migration version column so re-shaped migrations don't need _v2 suffixes

2 participants