mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
fix(store): handle version 0 with existing tables gracefully
Instead of throwing a schema mismatch error when version is 0 but tables already exist, set the version and return. This allows the database to properly initialize without erroring.
This commit is contained in:
@@ -254,7 +254,8 @@ export class Store {
|
||||
const currentVersion = this.getUserVersion()
|
||||
if (currentVersion === 0) {
|
||||
if (this.hasAnyUserTables()) {
|
||||
throw this.buildSchemaMismatchError(currentVersion)
|
||||
this.setUserVersion(SCHEMA_VERSION)
|
||||
return
|
||||
}
|
||||
|
||||
this.createSchema()
|
||||
|
||||
Reference in New Issue
Block a user