Skip to content

Commit

Permalink
migration fixed after pull
Browse files Browse the repository at this point in the history
  • Loading branch information
unclekingpin committed Nov 25, 2023
1 parent afef088 commit 5d5f944
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub const NOTIFICATION_ITEMS_COUNT: usize = 100;
pub const WATCHED_THRESHOLD_COEF: f64 = 0.7;
pub const CREDITS_THRESHOLD_COEF: f64 = 0.9;
/// The latest migration scheme version
pub const SCHEMA_VERSION: u32 = 10;
pub const SCHEMA_VERSION: u32 = 11;
pub const IMDB_LINK_CATEGORY: &str = "imdb";
pub const GENRES_LINK_CATEGORY: &str = "Genres";
pub const CINEMETA_TOP_CATALOG_ID: &str = "top";
Expand Down
12 changes: 9 additions & 3 deletions src/runtime/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,12 @@ pub trait Env {
.await?;
schema_version = 10;
}
if schema_version == 10 {
migrate_storage_schema_to_v11::<Self>()
.map_err(|error| EnvError::StorageSchemaVersionUpgrade(Box::new(error)))
.await?;
schema_version = 11;
}
if schema_version != SCHEMA_VERSION {
panic!(
"Storage schema version must be upgraded from {} to {}",
Expand Down Expand Up @@ -536,9 +542,9 @@ mod test {
},
runtime::{
env::{
migrate_storage_schema_to_v10, migrate_storage_schema_to_v6,
migrate_storage_schema_to_v7, migrate_storage_schema_to_v8,
migrate_storage_schema_to_v9,
migrate_storage_schema_to_v10, migrate_storage_schema_to_v11,
migrate_storage_schema_to_v6, migrate_storage_schema_to_v7,
migrate_storage_schema_to_v8, migrate_storage_schema_to_v9,
},
Env,
},
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/msg/action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use crate::{
types::{
addon::Descriptor,
api::AuthRequest,
library::{LibraryItemId, LibraryItem},
library::{LibraryItem, LibraryItemId},
profile::Settings as ProfileSettings,
resource::{MetaItemId, MetaItemPreview, Video},
},
Expand Down

0 comments on commit 5d5f944

Please sign in to comment.