runic-migrate

Guides graph schema migrations with runic across FalkorDB, Memgraph, Neo4j, ArcadeDB, and Apache AGE.

Updated Jun 13, 2026
One-click install
npx skills add https://github.com/jenreh/project-kit-template --skill runic-migrate-jenreh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: runic-migrate
Source: https://github.com/jenreh/project-kit-template/tree/main/.agents/agent-skills/skills/runic-migrate
Command: npx skills add https://github.com/jenreh/project-kit-template --skill runic-migrate-jenreh

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires runic, and includes references (resource) components.

What problem does it solve? Graph databases lack the mature schema migration tooling that relational databases have with Alembic. This Skill provides expert guidance for runic, an Alembic-style migration framework that versions graph schema changes (indexes, constraints, data transformations) as Python scripts and tracks applied revisions inside the graph itself. ## Core Features & Use Cases - Full CLI workflow: Scaffold environments with runic init, create revisions, upgrade/downgrade with relative targets, branch and merge heads, and stamp baselines on existing graphs. - Complete op. API reference*: Create and drop range, fulltext, and vector indexes plus UNIQUE/MANDATORY constraints, with correct ordering rules (indexes before constraints in upgrade, constraints before indexes in downgrade). - Safe data migrations: Batched idempotent operations like rename_property, relabel_nodes, and seed, with irreversible and snapshot flags for one-way or risky changes. - Autogenerate and CI gating: Diff a SchemaManifest against the live graph with runic revision --autogenerate and enforce schema sync in pipelines with runic check. - Use Case: You need to rename a property on millions of Person nodes in FalkorDB without downtime. The Skill shows you how to write an idempotent batched migration with snapshot = True so runic copies the graph before upgrading and restores automatically on failure. ## Quick Start Ask the assistant to scaffold a runic migration environment and write a revision that adds a unique email constraint on User nodes, then apply it with runic upgrade head.

Frequently Asked Questions about runic-migrate

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a graph schema migration with runic?

Run `runic init` to scaffold the environment, edit `runic/env.py` to configure your adapter, then run `runic revision -m "message"` to generate a file in versions/. Implement `upgrade(op)` and `downgrade(op)` using op.* calls, then apply with `runic upgrade head`.

How do I add a unique constraint in a FalkorDB migration?

Call `op.create_range_index(label, prop)` first, then `op.create_constraint("UNIQUE", "NODE", label, [prop])` in upgrade. In downgrade, drop the constraint before dropping the backing range index, or FalkorDB will refuse the index drop.

Which graph databases does runic support?

Runic supports FalkorDB, Memgraph, Neo4j, ArcadeDB, and Apache AGE through pluggable adapters created with `create_adapter`. Note that `relabel_nodes` requires multi-label support and raises NotImplementedError on Apache AGE and ArcadeDB.

How do I handle an irreversible data migration safely?

Set `irreversible = True` so downgrades are blocked unless `--force` is passed, and `snapshot = True` so runic copies the graph with GRAPH.COPY before upgrading and restores it automatically on failure. Keep data steps idempotent using MERGE or guarded WHERE clauses.

Can runic autogenerate migrations from my live graph?

Yes. Define a `target_manifest` SchemaManifest in env.py, then run `runic revision --autogenerate -m "msg"` to diff the manifest against the live schema and emit candidate op.* calls. Autogenerate covers indexes and constraints only and cannot detect renames, so always review the output.

How do I resolve multiple heads in runic migration history?

Run `runic heads` to list divergent heads, then `runic merge <rev1> <rev2> -m "message"` to create a merge revision whose down_revision is a tuple of both parent ids. Add any reconciliation ops to the merge file's upgrade body, then run `runic upgrade head`.