Skip to content

Commit bd39b33

Browse files
committed
fix: duplicated storage migration contnet
1 parent 2f31c4c commit bd39b33

File tree

2 files changed

+4
-68
lines changed

2 files changed

+4
-68
lines changed

develop/parachains/maintenance/runtime-upgrades.md

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -49,38 +49,6 @@ The runtime metadata should only change when the chain's [runtime `spec_version`
4949

5050
## Storage Migrations
5151

52-
[Storage migrations](https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/reference_docs/frame_runtime_upgrades_and_migrations/index.html#migrations){target=\_blank} are custom, one-time functions that allow you to update storage to adapt to changes in the runtime.
52+
Some runtime upgrades require updating how data is stored to match new formats or layouts. This process is called a Storage Migration. It ensures the runtime can interpret existing state correctly after an upgrade.
5353

54-
For example, if a runtime upgrade changes the data type used to represent user balances from an unsigned integer to a signed integer, the storage migration would read the existing value as an unsigned integer and write back an updated value that has been converted to a signed integer.
55-
56-
If you don't make changes to how data is stored when needed, the runtime can't properly interpret the storage values to include in the runtime state and is likely to lead to undefined behavior.
57-
58-
### Storage Migrations with FRAME
59-
60-
FRAME storage migrations are implemented using the [`OnRuntimeUpgrade`](https://paritytech.github.io/polkadot-sdk/master/frame_support/traits/trait.OnRuntimeUpgrade.html){target=\_blank} trait. The `OnRuntimeUpgrade` trait specifies a single function, `on_runtime_upgrade`, that allows you to specify logic to run immediately after a runtime upgrade but before any `on_initialize` functions or transactions are executed.
61-
62-
For further details about this process, see the [Storage Migrations](/develop/parachains/maintenance/storage-migrations/){target=\_blank} page.
63-
64-
### Ordering Migrations
65-
66-
By default, FRAME orders the execution of `on_runtime_upgrade` functions based on the order in which the pallets appear in the `construct_runtime!` macro. The functions run in reverse order for upgrades, starting with the last pallet executed first. You can impose a custom order if needed.
67-
68-
FRAME storage migrations run in this order:
69-
70-
1. Custom `on_runtime_upgrade` functions if using a custom order
71-
2. System `frame_system::on_runtime_upgrade` functions
72-
3. All `on_runtime_upgrade` functions defined in the runtime starting with the last pallet in the `construct_runtime!` macro
73-
74-
<!-- ## Where to Go Next
75-
76-
<div class="grid cards" markdown>
77-
78-
- <span class="badge tutorial">Tutorial</span> __Add Pallets to the Runtime__
79-
80-
---
81-
82-
TODO!
83-
84-
[:octicons-arrow-right-24: Get started](/tutorials/polkadot-sdk/parachains/zero-to-hero/add-pallets-to-runtime/)
85-
86-
</div> -->
54+
For detailed guidance, scenarios, and implementation patterns, see [Storage Migrations](/develop/parachains/maintenance/storage-migrations/){target=\_blank} page.

llms.txt

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5918,41 +5918,9 @@ The runtime metadata should only change when the chain's [runtime `spec_version`
59185918

59195919
## Storage Migrations
59205920

5921-
[Storage migrations](https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/reference_docs/frame_runtime_upgrades_and_migrations/index.html#migrations){target=\_blank} are custom, one-time functions that allow you to update storage to adapt to changes in the runtime.
5921+
Some runtime upgrades require updating how data is stored to match new formats or layouts. This process is called a Storage Migration. It ensures the runtime can interpret existing state correctly after an upgrade.
59225922

5923-
For example, if a runtime upgrade changes the data type used to represent user balances from an unsigned integer to a signed integer, the storage migration would read the existing value as an unsigned integer and write back an updated value that has been converted to a signed integer.
5924-
5925-
If you don't make changes to how data is stored when needed, the runtime can't properly interpret the storage values to include in the runtime state and is likely to lead to undefined behavior.
5926-
5927-
### Storage Migrations with FRAME
5928-
5929-
FRAME storage migrations are implemented using the [`OnRuntimeUpgrade`](https://paritytech.github.io/polkadot-sdk/master/frame_support/traits/trait.OnRuntimeUpgrade.html){target=\_blank} trait. The `OnRuntimeUpgrade` trait specifies a single function, `on_runtime_upgrade`, that allows you to specify logic to run immediately after a runtime upgrade but before any `on_initialize` functions or transactions are executed.
5930-
5931-
For further details about this process, see the [Storage Migrations](/develop/parachains/maintenance/storage-migrations/){target=\_blank} page.
5932-
5933-
### Ordering Migrations
5934-
5935-
By default, FRAME orders the execution of `on_runtime_upgrade` functions based on the order in which the pallets appear in the `construct_runtime!` macro. The functions run in reverse order for upgrades, starting with the last pallet executed first. You can impose a custom order if needed.
5936-
5937-
FRAME storage migrations run in this order:
5938-
5939-
1. Custom `on_runtime_upgrade` functions if using a custom order
5940-
2. System `frame_system::on_runtime_upgrade` functions
5941-
3. All `on_runtime_upgrade` functions defined in the runtime starting with the last pallet in the `construct_runtime!` macro
5942-
5943-
<!-- ## Where to Go Next
5944-
5945-
<div class="grid cards" markdown>
5946-
5947-
- <span class="badge tutorial">Tutorial</span> __Add Pallets to the Runtime__
5948-
5949-
---
5950-
5951-
TODO!
5952-
5953-
[:octicons-arrow-right-24: Get started](/tutorials/polkadot-sdk/parachains/zero-to-hero/add-pallets-to-runtime/)
5954-
5955-
</div> -->
5923+
For detailed guidance, scenarios, and implementation patterns, see [Storage Migrations](/develop/parachains/maintenance/storage-migrations/){target=\_blank} page.
59565924
--- END CONTENT ---
59575925

59585926
Doc-Content: https://docs.polkadot.com/develop/parachains/maintenance/storage-migrations/

0 commit comments

Comments
 (0)