Skip to content

Desktop upgrade can fail on workspace migration #32430

Description

@neriousy

Description

Upgrading some older desktop installs can fail during database migration with:

no such column: name

The failing path is 20260410174513_workspace-name. It rebuilds the workspace table and copies workspace.name, but some upgraded databases have a legacy workspace shape that already has type, directory, and extra while still missing name.

Minimal repro: https://github.com/neriousy/opencode-workspace-migration-repro

The repro now includes copied opencode migration file versions under opencode-migrations/ and executes the copied 20260410174513_workspace-name/migration.sql for the failing case.

Suspected origin:

  • 7f37acdaaa89b358fb795ccd006d37ed7fa6672e (feat(core): rework workspace integration and adaptor interface, package version 1.2.16) added 20260303231226_add_workspace_fields/migration.sql, which normally adds nullable workspace.name.
  • bf50d1c028e973ccc0beffdf568fca417b62f020 (feat(core): expose workspace adaptors to plugins, package version 1.4.3) added 20260410174513_workspace-name/migration.sql, whose copy step assumes workspace.name already exists.
  • 7f571d36ea56cc3dd7059cfe82c729fb52b121eb (refactor(core): move database schema ownership, package version 1.15.13) moved the migration into packages/core/src/database/migration/20260410174513_workspace-name.ts with the same SELECT name assumption. Builds containing this path can surface the older assumption during upgrade.
  • Proposed fix is mirrored in the repro at opencode-migrations/20260410174513_workspace-name/proposed-fix.ts.

Plugins

N/A

OpenCode version

Observed in newer desktop upgrades; suspected affected line starts with builds containing 7f571d36 / package version 1.15.13, with the unsafe migration originally introduced in 1.4.3.

Steps to reproduce

  1. Clone https://github.com/neriousy/opencode-workspace-migration-repro.
  2. Run bun run repro.
  3. The copied opencode SQL migration fails while selecting name from workspace, then the proposed fix path succeeds.

Screenshot and/or share link

https://github.com/neriousy/opencode-workspace-migration-repro

Operating System

Desktop, observed during upgrades from older installs.

Terminal

N/A

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions