@@ -1437,13 +1437,24 @@ impl Get<Perbill> for NominationPoolsMigrationV4OldPallet {
14371437///
14381438/// This contains the combined migrations of the last 10 releases. It allows to skip runtime
14391439/// upgrades in case governance decides to do so. THE ORDER IS IMPORTANT.
1440- pub type Migrations =
1441- ( migrations:: V0940 , migrations:: V0941 , migrations:: V0942 , migrations:: Unreleased ) ;
1440+ pub type Migrations = (
1441+ migrations:: V0938 ,
1442+ migrations:: V0940 ,
1443+ migrations:: V0941 ,
1444+ migrations:: V0942 ,
1445+ migrations:: Unreleased ,
1446+ ) ;
14421447
14431448/// The runtime migrations per release.
14441449#[ allow( deprecated, missing_docs) ]
14451450pub mod migrations {
14461451 use super :: * ;
1452+ use frame_support:: traits:: { GetStorageVersion , OnRuntimeUpgrade , StorageVersion } ;
1453+
1454+ pub type V0938 = (
1455+ pallet_xcm:: migration:: v1:: MigrateToV1 < Runtime > ,
1456+ parachains_ump:: migration:: v1:: MigrateToV1 < Runtime > ,
1457+ ) ;
14471458
14481459 pub type V0940 = (
14491460 pallet_nomination_pools:: migration:: v4:: MigrateToV4 <
@@ -1460,7 +1471,29 @@ pub mod migrations {
14601471 ) ;
14611472
14621473 /// Unreleased migrations. Add new ones here:
1463- pub type Unreleased = ( ) ;
1474+ pub type Unreleased = SetStorageVersions ;
1475+
1476+ /// Migrations that set `StorageVersion`s we missed to set.
1477+ pub struct SetStorageVersions ;
1478+
1479+ impl OnRuntimeUpgrade for SetStorageVersions {
1480+ fn on_runtime_upgrade ( ) -> Weight {
1481+ // `Referenda` pallet was added on chain after the migration to version `1` was added.
1482+ // Thus, it never required the migration and we just missed to set the correct `StorageVersion`.
1483+ let storage_version = Referenda :: on_chain_storage_version ( ) ;
1484+ if storage_version < 1 {
1485+ StorageVersion :: new ( 1 ) . put :: < Referenda > ( ) ;
1486+ }
1487+
1488+ // Was missed as part of: `runtime_common::session::migration::ClearOldSessionStorage<Runtime>`.
1489+ let storage_version = Historical :: on_chain_storage_version ( ) ;
1490+ if storage_version < 1 {
1491+ StorageVersion :: new ( 1 ) . put :: < Historical > ( ) ;
1492+ }
1493+
1494+ RocksDbWeight :: get ( ) . reads_writes ( 2 , 2 )
1495+ }
1496+ }
14641497}
14651498
14661499/// Unchecked extrinsic type as expected by this runtime.
0 commit comments