Repository navigation
Conversation
📊 Automated PR Analysis
SummaryAdds a Review Checklist
Analyzed automatically by wshm · This is an automated analysis, not a human review. |
6 tasks done
KuSh
force-pushed
the
fix/schema-version-enum
branch
from
November 4, 2026 18:27
f8f8180 to
d3a5497
Compare
KuSh
force-pushed
the
fix/db-schema-snapshot
branch
from
November 4, 2026 18:27
2899264 to
09e6430
Compare
KuSh
force-pushed
the
fix/schema-version-enum
branch
from
November 6, 2026 18:18
d3a5497 to
5c66e2a
Compare
KuSh
force-pushed
the
fix/db-schema-snapshot
branch
from
November 6, 2026 18:18
09e6430 to
ab35d47
Compare
13 tasks done
KuSh
force-pushed
the
fix/schema-version-enum
branch
from
November 6, 2026 19:30
5c66e2a to
9690e12
Compare
KuSh
force-pushed
the
fix/db-schema-snapshot
branch
from
November 6, 2026 19:30
ab35d47 to
59c07dd
Compare
KuSh
force-pushed
the
fix/schema-version-enum
branch
from
November 17, 2026 00:32
9690e12 to
94aa52e
Compare
KuSh
force-pushed
the
fix/db-schema-snapshot
branch
from
November 17, 2026 00:33
59c07dd to
d5f059a
Compare
A database with no schema object is created from its snapshot in one transaction instead of replaying every step; others keep the step path. Per-database tests keep each snapshot equal to what its steps produce. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
KuSh
force-pushed
the
fix/db-schema-snapshot
branch
from
November 19, 2026 00:22
d5f059a to
d756ba6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #4894: this PR's base is a copy of that branch, so the diff shows only this change. It is retargeted to
developonce #4894 is merged.Summary
A database with no schema object is now created directly at its latest schema, in one transaction, instead of replaying every migration step from version 1. Each
db::Schemacarries asnapshot: the SQL that creates the schema its last step produces, with columns in the order the steps leave them. Existing databases (legacy unversioned, partial, or at an intermediate stamp) keep the step path.The engine uses the snapshot at the start of
run_steps, in an IMMEDIATE transaction that re-reads the tag and the stamp under the lock: when the stamp is 0 andsqlite_masteris empty it runs the snapshot, stamps the last step's version and writes the tag together. That covers a file this open just created, an empty file, and two processes creating the same file at once (the second finds it current under the lock).rtk init(Always) uses it on an empty database too, and replays the steps on any other.A schema change now updates its step and the snapshot. A per-database equivalence test builds one database from the snapshot and one through every step from empty, compares them structurally (columns by position, type,
NOT NULL, default and primary key; indexes by uniqueness, origin and ordered columns; the tag and the stamp), and fails naming the differing lines. The rule is documented ondb::Schemanext to the rules for steps.migrate_initialtwice (Initial, thenInitialRecheck) and is created in one transaction.Test plan
rtk initon an empty database takes the snapshot; on a database with tables it replays the stepsreplay_steps), so they still pin what each step doesNOT NULL, a missing or non-unique index, index columns in another order or direction, and an extra tablecargo fmt --all,cargo clippy --all-targets,cargo test --all(also--no-default-features)🤖 Generated with Claude Code