Add error handling for outdated clients running against newer DB schemas#741
Merged
RhysSullivan merged 4 commits intoRhysSullivan:mainfrom May 10, 2026
Merged
Conversation
6dcd5e4 to
ddaab4b
Compare
- Use loose != null in drizzleMigrationsTableExists so undefined rows from bun:sqlite's .get() are treated as missing. - Plumb the resolved dataDir through checkDrizzleMigrationCompatibility instead of re-reading process.env.EXECUTOR_DATA_DIR at error-format time, keeping the message aligned with resolveDbPath().
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.
Context
A user can currently hit an opaque SQLite error when switching between Executor builds that know different local DB schemas:
executorbinary againstEXECUTOR_DATA_DIR.bun dev:cli) against the sameEXECUTOR_DATA_DIR, which applies newer local Drizzle migrations.no such column: invocation_config.Changes
Add a read-only/synchronous preflight in local executor startup, immediately before
migrate(db, { migrationsFolder: MIGRATIONS_FOLDER }).The preflight will:
__drizzle_migrationsexists.moveAsidePreScopeDb,readLegacySecrets).__drizzle_migrationsexists, read applied hashes ordered byid ASC.idis autoincrement, monotonic, non-null, and avoids timestamp tie issues.meta/_journal.json.idx.${entry.tag}.sqlas raw text.LocalDatabaseSchemaTooNew.LocalDatabaseMigrationHistoryMismatch.__drizzle_migrationsexists but is empty: pass and let Drizzle run all migrations.Two new errors:
LocalDatabaseSchemaTooNew: likely opened by a newer Executor; user action is to update Executor or choose anotherEXECUTOR_DATA_DIR.LocalDatabaseMigrationHistoryMismatch: DB history does not match this binary's migration lineage; likely different branch/corruption/manual modification; user probably cannot fix this by merely updating to the same release line.