Repository navigation
Add SolidErrors.migrated? to check the errors database schema - #113
Merged
Merged
Conversation
Apps can assert it in their test suite so a schema change from an upgrade fails there instead of in production. Fixes #31. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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 #31.
SolidErrors.migrated?is true when the errors database has every table and column the installed version reads and writes. As #31 suggests, following GoodJob, apps can assert it in their test suite, so a schema change from an upgrade fails there and not in production:Solid Errors ships one schema rather than migrations, so the check compares the tables against the columns this version uses. When a release changes the schema, that release updates the list in
migrated?and adds the migration to UPGRADE.md.Tests cover the current schema, a missing column, and a missing table. The tests that drop a column or table do so inside their test transaction, which rolls the change back.
🤖 Generated with Claude Code