Skip to content

Commit d162e1c

Browse files
authored
[FIX] - Duplicated storage migration content (#890)
* fix: duplicated storage migration contnet * fix: grammarly
1 parent 20b4e6f commit d162e1c

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 the [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
@@ -6418,41 +6418,9 @@ The runtime metadata should only change when the chain's [runtime `spec_version`
64186418

64196419
## Storage Migrations
64206420

6421-
[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.
6421+
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.
64226422

6423-
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.
6424-
6425-
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.
6426-
6427-
### Storage Migrations with FRAME
6428-
6429-
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.
6430-
6431-
For further details about this process, see the [Storage Migrations](/develop/parachains/maintenance/storage-migrations/){target=\_blank} page.
6432-
6433-
### Ordering Migrations
6434-
6435-
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.
6436-
6437-
FRAME storage migrations run in this order:
6438-
6439-
1. Custom `on_runtime_upgrade` functions if using a custom order
6440-
2. System `frame_system::on_runtime_upgrade` functions
6441-
3. All `on_runtime_upgrade` functions defined in the runtime starting with the last pallet in the `construct_runtime!` macro
6442-
6443-
<!-- ## Where to Go Next
6444-
6445-
<div class="grid cards" markdown>
6446-
6447-
- <span class="badge tutorial">Tutorial</span> __Add Pallets to the Runtime__
6448-
6449-
---
6450-
6451-
TODO!
6452-
6453-
[:octicons-arrow-right-24: Get started](/tutorials/polkadot-sdk/parachains/zero-to-hero/add-pallets-to-runtime/)
6454-
6455-
</div> -->
6423+
For detailed guidance, scenarios, and implementation patterns, see the [Storage Migrations](/develop/parachains/maintenance/storage-migrations/){target=\_blank} page.
64566424
--- END CONTENT ---
64576425

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

0 commit comments

Comments
 (0)