Install
openclaw skills install schema-migration-diffAnalyze differences between knowledge graph schema versions and generate migration plans and scripts for safe schema evolution.
openclaw skills install schema-migration-diffDetect schema differences and generate migration plans for graph evolution.
This skill compares two knowledge graph schema versions and generates safe migration strategies.
Schema v1:
Student: student_id, name, email
Course: course_code, title
(Student)-[:ENROLLED_IN]->(Course)
Schema v2:
Student: student_id, full_name, email
Course: course_code, title, credits
Department: dept_id, name
(Student)-[:ENROLLED_IN]->(Course)
(Course)-[:BELONGS_TO]->(Department)
Diff Report:
ADDED:
+ Department label
+ Course.credits property
+ (Course)-[:BELONGS_TO]->(Department) relationship
MODIFIED:
~ Student.name → Student.full_name (rename)
REMOVED:
(none)
Risk: Medium | Complexity: Medium
Schema Migration: v1 → v2
========================
ENTITY CHANGES:
+ Department
PROPERTY CHANGES:
Student.name → Student.full_name
RELATIONSHIP CHANGES:
+ (Course)-[:BELONGS_TO]->(Department)
Migration Steps: 3
Risk Level: Medium
Estimated Time: 30 minutes
-- 1. Add constraint for new entity
CREATE CONSTRAINT department_id_unique
FOR (d:Department) REQUIRE d.department_id IS UNIQUE
-- 2. Rename property
MATCH (s:Student)
WHERE s.name IS NOT NULL
SET s.full_name = s.name
REMOVE s.name
-- 3. Add new relationship
CREATE (c:Course)-[:BELONGS_TO]->(d:Department)
✓ Test migrations on staging data first
✓ Create backups before migration
✓ Maintain backward compatibility
✓ Document all schema changes
✓ Version all schemas
✓ Review migration scripts carefully
✓ Perform migrations incrementally
✓ Validate data after migration
See migration-patterns.md for migration strategies and example-migrations.md for domain migration examples.
Version: 1.0.0