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 | migrationName raw: key1 | Vec<u8> Vec | key1 (Vec<u8>) |
Stored Value
value (bool)
Code Examples
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443
const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);
// Query HasMigrationRun storage
const key1 = Binary.fromOpaque(new Uint8Array(0));
const result = await api.query.SubtensorModule.HasMigrationRun.getValue(key1);
console.log("HasMigrationRun:", result);Runtime Info
View Source- Pallet
- SubtensorModule
- Storage Kind
- Map
- First Version
- v165
- Current Version
- v411