Repository navigation
fix: prevent schema-incompatible installer downgrades - #18
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR raises the SQLite schema version to 19 and introduces new migrations (17–19) to handle divergent database lineages and preserve compatibility with development builds, while also updating the install script to validate database compatibility before replacing the installed binary to avoid schema-incompatible downgrades.
Changes:
- Update installer flow to run a compatibility check using the downloaded candidate binary before installing it.
- Bump store schema version to 19 and add migrations 17–19 (automatic tasks convergence, card policy/APN table rebuild, IMS/VoWiFi compatibility columns).
- Add tests covering migration-19 compatibility and enforcing installer validation ordering.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/install.sh | Validates DB compatibility with downloaded binary before replacing the installed binary. |
| internal/store/store.go | Bumps supported SQLite schema version to 19 and updates additive-column duplicate handling for migration 19. |
| internal/store/migrations.go | Adds migrations 17–19 to converge schemas and preserve dev-build compatibility columns. |
| internal/store/domain_test.go | Adds migration tests ensuring dev DBs upgrade to schema 19 without losing card/APN data. |
| cmd/vocat/install_script_test.go | Adds a test to ensure installer validates DB before installing the binary. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+364
to
+368
| `DROP TABLE card_apn_profiles_v17`, | ||
| `DROP TABLE card_policies_v17`, | ||
| `ALTER TABLE card_apn_profiles_new RENAME TO card_apn_profiles`, | ||
| `CREATE INDEX card_apn_profiles_iccid_idx ON card_apn_profiles(iccid, id)`, | ||
| } |
Comment on lines
+539
to
+543
| # Validate the database with the downloaded binary before replacing the | ||
| # installed program. In particular, a release with an older schema must never | ||
| # overwrite a newer working binary and leave the service in a restart loop. | ||
| bootstrap_admin "${VOCAT_TMP}/vocat" | ||
| install_binary |
MengMengCode
added a commit
that referenced
this pull request
Aug 15, 2026
Add schema 17–19 compatibility migrations
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.
Add schema 17–19 compatibility migrations