Replace script file hashing with schema hashing in migrations#2304
Open
gabrielbosio wants to merge 3 commits into
Open
Replace script file hashing with schema hashing in migrations#2304gabrielbosio wants to merge 3 commits into
gabrielbosio wants to merge 3 commits into
Conversation
gabrielbosio
marked this pull request as ready for review
July 6, 2026 21:56
JereSalo
approved these changes
Jul 16, 2026
JereSalo
left a comment
Collaborator
There was a problem hiding this comment.
- We can remove the migrations table from
sqlite-store/src/store.sqlas it's no longer used after this PR. And with this we could remove the added test ofstale_migrations_row_does_not_affect_acceptance, as it's not necessary. I think removing the table would be breaking but if this goes tonextthen it shouldn't be something to worry about I guess.
| fn schema_hash(conn: &Connection) -> Result<Hash> { | ||
| let mut stmt = conn.prepare( | ||
| "SELECT type, name, tbl_name, sql FROM sqlite_schema \ | ||
| WHERE sql IS NOT NULL AND name NOT LIKE 'sqlite_%' \ |
Collaborator
There was a problem hiding this comment.
nit: in LIKE the _ symbol behaves as a single character wildcard, and here we want to say that the name shouldn't start with "sqlite_". If we wanted to be more precise we could use name NOT GLOB 'sqlite_*' instead (note that GLOB uses * as multi-character wildcard).
This just covers against unlikely edge cases in which you have an object named, for example, "sqlitesomething" and we don't want to ignore it for the fingerprint in that case.
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.
Closes #2307.