Skip to content

fix: prevent schema-incompatible installer downgrades - #18

Merged
MengMengCode merged 1 commit into
masterfrom
fix/schema19-update-compat
Aug 14, 2026
Merged

MengMengCode merged 1 commit into
masterfrom
fix/schema19-update-compat

Conversation

@MengMengCode

@MengMengCode MengMengCode commented Aug 14, 2026 •

Copy link
Copy Markdown
Owner

Add schema 17–19 compatibility migrations

Copilot AI lite review requested due to automatic review settings August 14, 2026 12:58
@MengMengCode
MengMengCode merged commit edbd0ef into master Aug 14, 2026
7 of 8 checks passed
@MengMengCode
MengMengCode deleted the fix/schema19-update-compat branch August 14, 2026 13:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 thread scripts/install.sh
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants