diff --git a/pallets/schemas/src/migration/v3.rs b/pallets/schemas/src/migration/v3.rs index 2683bada6a..a9521e0269 100644 --- a/pallets/schemas/src/migration/v3.rs +++ b/pallets/schemas/src/migration/v3.rs @@ -49,6 +49,7 @@ pub fn get_known_schemas() -> BTreeMap> { pub mod old { use super::*; use common_primitives::schema::{ModelType, PayloadLocation, SchemaSettings}; + use frame_support::storage_alias; #[derive(Clone, Encode, Decode, PartialEq, Debug, TypeInfo, Eq, MaxEncodedLen)] /// A structure defining a Schema information (excluding the payload) @@ -60,6 +61,11 @@ pub mod old { /// additional control settings for the schema pub settings: SchemaSettings, } + + /// Old Storage for schema info struct data + #[storage_alias] + pub(crate) type SchemaInfos = + StorageMap, Twox64Concat, SchemaId, OldSchemaInfo, OptionQuery>; } /// migration to v3 implementation @@ -73,7 +79,7 @@ impl OnRuntimeUpgrade for MigrateToV3 { #[cfg(feature = "try-runtime")] fn pre_upgrade() -> Result, TryRuntimeError> { log::info!(target: LOG_TARGET, "Running pre_upgrade..."); - let count = SchemaInfos::::iter().count() as u32; + let count = old::SchemaInfos::::iter().count() as u32; log::info!(target: LOG_TARGET, "Finish pre_upgrade for {:?}", count); Ok(count.encode()) }