HasMigrationRun
Storage Map v301 → v411 Changed in v411Tracks whether specific migrations have been executed.
Explore chainQueried by: developers
The Big Picture
This is internal bookkeeping for runtime migrations. When the Drand pallet upgrades, it may need to run one-time migrations. This storage tracks which have executed to prevent re-running.
Why This Matters
Mostly internal - you rarely need this unless debugging migration issues during upgrades.
Example Scenario
Query HasMigrationRun('v2_upgrade') returns true - that migration already executed.
Common Questions
- Should I ever modify this?
- No - this is managed by the runtime upgrade process. Manual modification could cause migrations to re-run or skip incorrectly.
Use Cases
- Debug migration execution during chain upgrades
- Verify migration state for troubleshooting
From Chain Metadata
Storage for migration run status
Purpose & Usage
Purpose
Internal migration tracking to prevent duplicate execution of one-time migrations.
Common Query Patterns
- Check if a migration has already run
- Debug migration issues during upgrades
Notes
- Maps migration identifier to boolean
- Used internally during runtime upgrades
Query Keys
| # | Name | Type | Description |
|---|---|---|---|
| 1 | migrationName raw: key1 | Vec<u8> Vec Vec<T> | 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.Drand.HasMigrationRun.getValue(key1);
console.log("HasMigrationRun:", result);Version History
v301 block 6,205,194 Added
v316–v319 · runtime versions skipped on chain (never deployed)
v320 block 6,523,566 Internal re-bind
v324–v325 · runtime versions skipped on chain (never deployed)
v326 block 6,608,228 Internal re-bind
v327–v333 · runtime versions skipped on chain (never deployed)
v334 block 6,811,690 Internal re-bind
v353–v360 · runtime versions skipped on chain (never deployed)
v361 block 7,063,679 Internal re-bind
v363–v364 · runtime versions skipped on chain (never deployed)
v365 block 7,135,419 Internal re-bind
v378–v384 · runtime versions skipped on chain (never deployed)
v385 block 7,782,670 Internal re-bind
v386–v390 · runtime versions skipped on chain (never deployed)
v391 block 7,782,857 Internal re-bind
v394–v400 · runtime versions skipped on chain (never deployed)
v401 block 8,036,576 Internal re-bind
v403–v410 · runtime versions skipped on chain (never deployed)
v411 block 8,283,784 Internal re-bind Current
Runtime Info
View Source- Pallet
- Drand
- Storage Kind
- Map
- First Version
- v301
- Current Version
- v411