diff --git a/util/src/migration/mod.rs b/util/src/migration/mod.rs index 3f0a7a806..f4a00fee3 100644 --- a/util/src/migration/mod.rs +++ b/util/src/migration/mod.rs @@ -169,8 +169,11 @@ impl Migration for T { /// An even simpler migration which just changes the number of columns. pub struct ChangeColumns { + /// The amount of columns before this migration. pub pre_columns: Option, + /// The amount of columns after this migration. pub post_columns: Option, + /// The version after this migration. pub version: u32, } @@ -277,11 +280,11 @@ impl Manager { // Change number of columns in new db let current_columns = db_config.columns; db_config.columns = migration.columns(); + temp_path = temp_idx.path(&db_root); // slow migrations: alter existing data. if migration.alters_existing() { // open the target temporary database. - temp_path = temp_idx.path(&db_root); let temp_path_str = temp_path.to_str().ok_or(Error::MigrationImpossible)?; let mut new_db = Database::open(&db_config, temp_path_str).map_err(Error::Custom)?;