Disable defer_foreign_keys during sqlite migration#407
Open
jayvdb wants to merge 7 commits intoElectron100:masterfrom
Open
Disable defer_foreign_keys during sqlite migration#407jayvdb wants to merge 7 commits intoElectron100:masterfrom
jayvdb wants to merge 7 commits intoElectron100:masterfrom
Conversation
jayvdb
commented
Nov 2, 2025
butane_core/src/db/sqlite.rs
Outdated
| let stmts: [&str; 4] = [ | ||
| // Wrap in PRAGMA defer_foreign_keys to allow dropping tables that are referenced | ||
| let stmts: [&str; 6] = [ | ||
| "PRAGMA defer_foreign_keys = ON;", |
Collaborator
Author
There was a problem hiding this comment.
not sure I like this, but it does solve one of our rollback problems.
8f42c37 to
ffeef6e
Compare
Electron100
approved these changes
Nov 5, 2025
ffeef6e to
0e8162e
Compare
jayvdb
commented
Nov 8, 2025
Comment on lines
592
to
+595
| //future improvement: support column renames | ||
| /// Disable constraint enforcement before migration operations. | ||
| /// Used when operations require temporarily disabling foreign key checks or other constraints. | ||
| DisableConstraints, |
Collaborator
Author
There was a problem hiding this comment.
Again, I'm still not sure about this.
Perhaps rename to Preamble and Postamble/Epilogue , to be a bit more generic.
To be truely useful for allowing workarounds for complex situations, I feel that these new Ops should have arguments of old and new ADB, so that the backend has the full context and can then provide complex logic. But that feels like cheating.
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.
Fixes one of #226