HasMigrationRun
Storage Map v165 → currentTracks which migrations have been executed.
Explore chainQueried by: developersvalidators
The Big Picture
Runtime upgrades may require one-time migrations. This storage tracks which have run to prevent accidental re-execution. Maps migration identifiers to boolean status.
Use Cases
- Check migration status
- Debug upgrade issues
- Build migration monitoring tools
Purpose & Usage
Purpose
Prevent duplicate execution of one-time migrations.
Common Query Patterns
- Query by migration name/key
Query Keys
| # | Name | Type | Description |
|---|---|---|---|
| 1 | key1 | Vec<u8> Vec | key1 (Vec<u8>) |
Stored Value
value (bool)
Code Examples
import { ApiPromise, WsProvider } from "@polkadot/api";
import { stringCamelCase } from "@polkadot/util";
const provider = new WsProvider("wss://entrypoint-finney.opentensor.ai:443");
const api = await ApiPromise.create({ provider });
// Query HasMigrationRun storage
const key1 = 0;
const result = await api.query
[stringCamelCase("SubtensorModule")]
[stringCamelCase("HasMigrationRun")](
key1
);
console.log("HasMigrationRun:", result.toHuman());Runtime Info
View Source- Pallet
- SubtensorModule
- Storage Kind
- Map
- First Version
- v165
- Current Version
- v393