fix: cannot have database at version 0

This commit is contained in:
Jeremy Wall 2024-07-12 00:23:05 -04:00
parent b93edd2701
commit f75652befa
2 changed files with 2 additions and 2 deletions

View File

@ -100,7 +100,7 @@ const APP_STATE_KEY: &'static str = "app-state";
impl LocalStore {
pub fn new() -> Self {
Self {
store: DBFactory::new("app-state", Some(0)),
store: DBFactory::new("app-state", Some(1)),
//old_store: js_lib::get_storage(),
}
}

View File

@ -45,7 +45,7 @@ impl<'name> DBFactory<'name> {
// database with an older version than the one we requested to build.
let db = evt.database();
// NOTE(jwall): This needs to be somewhat clever in handling version upgrades.
if db.version() == 0 {
if db.version() == 1 {
// We use out of line keys for this object store
db.build_object_store(STORE_NAME).create()?;
}