Repository navigation
fix: add the 2.8 sync columns to homepage and vault tables on upgrade - #1791
Open
ZacharyZcR wants to merge 1 commit into
Open
ZacharyZcR wants to merge 1 commit into
ZacharyZcR wants to merge 1 commit into
Conversation
2.8 added sync_id to dashboard_service_links, homepage_items and vault_profiles, and updated_at to dashboard_service_links, on start. 2.9 handed those tables to plugins and dropped that code, so a SQLite database upgraded from 2.5 straight to 2.9 or later never got the columns. The plugins read sync_id from their adopted tables, and sync logged "no such column: sync_id" on every pass while skipping that data. Run the existing snippets repair over these tables too, under both their legacy and adopted names, and fill a sync_id for every row. The repair is renamed to match. Fixes Termix-SSH/Plugin-Sync#8
|
AI review | Needs changes Adds missing sync and timestamp columns to legacy homepage and vault tables during SQLite upgrades to resolve sync failures for databases that skipped version 2.8. The change is safe, follows repository rules, and includes appropriate tests.
Reviewed 0d2b562. AI can be wrong, a maintainer still decides. Comment |
This branch has not been deployed
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 Termix-SSH/Plugin-Sync#8. That server was upgraded 2.5.1 → 2.9.2 → 26.11.0 on SQLite and logs
no such column: "sync_id"on every sync pass.2.8 added these columns on start (
release-2.8.0-tag,src/backend/database/db/index.ts):2.9 handed those tables to plugins and dropped that code. The plugins' adoption migrations use
CREATE TABLE IF NOT EXISTSfollowed by a rename, so an existing 2.5 table keeps its columns. A database that skipped 2.8 therefore never gets them. Homepage and Vault definesyncIdon the adopted tables, so every sync read of those rows fails and that kind of data is skipped. Snippets had the same gap and already has a repair in core. Homepage and Vault did not.This runs the existing repair over these tables too, under their legacy and adopted (
p_…) names. It adds the missing columns, fills async_idfor every row and creates the unique index, the same way it does for snippets. The columns come from comparing the plugins' current table definitions with 2.5.1's schema:homepage_itemsandvault_profilesonly misssync_id,dashboard_service_linksalso missesupdated_at, andhomepage_layoutsmisses nothing. Vault'sprovidercolumn comes from its own migration. Since the repair now covers more than snippets, the file and function are renamed (legacy-plugin-columns.ts,repairLegacyPluginColumns).Validation: a new test builds the three tables with their 2.5.1 columns under the adopted names, as on the reporter's server, and checks the columns and filled sync ids after repair. It fails with the previous table list. Full suite: 4638 passed, 1 skipped.
tsc -b, eslint, prettier and the test location check pass.