HasMigrationRun

Storage Map v301 → current

Tracks whether specific migrations have been executed.

Explore chain
Queried 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

#NameTypeDescription
1
key1
BoundedVec key1 (BoundedVec)

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 as any /* BoundedVec */;

const result = await api.query
  [stringCamelCase("Drand")]
  [stringCamelCase("HasMigrationRun")](
  key1
);

console.log("HasMigrationRun:", result.toHuman());

Runtime Info

View Source
Pallet
Drand
Storage Kind
Map
First Version
v301
Current Version
v393