@@ -49,6 +49,7 @@ pub fn get_known_schemas() -> BTreeMap<SchemaId, Vec<u8>> {
49
49
pub mod old {
50
50
use super :: * ;
51
51
use common_primitives:: schema:: { ModelType , PayloadLocation , SchemaSettings } ;
52
+ use frame_support:: storage_alias;
52
53
53
54
#[ derive( Clone , Encode , Decode , PartialEq , Debug , TypeInfo , Eq , MaxEncodedLen ) ]
54
55
/// A structure defining a Schema information (excluding the payload)
@@ -60,6 +61,11 @@ pub mod old {
60
61
/// additional control settings for the schema
61
62
pub settings : SchemaSettings ,
62
63
}
64
+
65
+ /// Old Storage for schema info struct data
66
+ #[ storage_alias]
67
+ pub ( crate ) type SchemaInfos < T : Config > =
68
+ StorageMap < Pallet < T > , Twox64Concat , SchemaId , OldSchemaInfo , OptionQuery > ;
63
69
}
64
70
65
71
/// migration to v3 implementation
@@ -73,7 +79,7 @@ impl<T: Config> OnRuntimeUpgrade for MigrateToV3<T> {
73
79
#[ cfg( feature = "try-runtime" ) ]
74
80
fn pre_upgrade ( ) -> Result < Vec < u8 > , TryRuntimeError > {
75
81
log:: info!( target: LOG_TARGET , "Running pre_upgrade..." ) ;
76
- let count = SchemaInfos :: < T > :: iter ( ) . count ( ) as u32 ;
82
+ let count = old :: SchemaInfos :: < T > :: iter ( ) . count ( ) as u32 ;
77
83
log:: info!( target: LOG_TARGET , "Finish pre_upgrade for {:?}" , count) ;
78
84
Ok ( count. encode ( ) )
79
85
}
0 commit comments