database-migrator — Claude Code skill: database migrations
database-migrator moves schemas, data, and database logic across PostgreSQL, MySQL, Supabase, PlanetScale, and MongoDB. Useful when a migration needs checks and a rollback plan.
MIT 267 installs ★ 440 updated 2026-10-20
npx skills add OneWave-AI/claude-skills --skill database-migrator -a claude-codeWhat database-migrator does
The skill inspects the source database, collecting tables, columns, types, defaults, constraints, indexes, foreign keys, triggers, procedures, views, sequences, and row counts. For MongoDB, it scans collections to infer a schema. It then maps data types, translates provider-specific SQL, and writes scripts for schema creation, data transfer, and database logic.
Its output includes row-count checks, checksums, foreign-key validation, index checks, and sample-data queries. It also creates reverse-order drop scripts, backup and restore commands, application rollback steps, a downtime estimate, and migration-plan.md with the execution sequence. A relational-to-MongoDB move requires schema redesign, so it cannot be treated as a simple dialect conversion.
Supported paths cover PostgreSQL, MySQL, Supabase, PlanetScale, and MongoDB in either direction. Before running it, provide the source and target providers, connection method, schema scope, data scope, data volume, application dependencies, and downtime tolerance.
What it helps with
- move a database between providers
- map incompatible data types
- generate schema and data migration scripts
- validate rows, checksums, and foreign keys
- prepare rollback steps and downtime estimates
Example prompts for the agent
- Move the schema and data from PostgreSQL to Supabase and create
migration-plan.md. - Compare types, indexes, triggers, and procedures while migrating from MySQL to PostgreSQL.
- Plan a MongoDB-to-PostgreSQL migration with data checks and rollback steps.
How to install database-migrator
1Skills CLI (Vercel)
npx skills add OneWave-AI/claude-skills --skill database-migrator -a claude-code2Manually: put the files in place
~/.claude/skills/database-migrator/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/database-migrator/
1Skills CLI (Vercel)
npx skills add OneWave-AI/claude-skills --skill database-migrator -a codex2Manually: put the files in place
.agents/skills/database-migrator/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add OneWave-AI/claude-skills --skill database-migrator -a cursor2Manually: put the files in place
.cursor/skills/database-migrator/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install OneWave-AI/claude-skills database-migrator2Manually: put the files in place
.github/skills/database-migrator/SKILL.md1Skills CLI (Vercel)
npx skills add OneWave-AI/claude-skills --skill database-migrator -a gemini-cli2Platform CLI
gemini skills install https://github.com/OneWave-AI/claude-skills --path database-migratorManually: put the files in place
.devin/skills/database-migrator/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add OneWave-AI/claude-skills --skill database-migrator -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about database-migrator
How do I install database-migrator in Claude Code?
Run npx skills add OneWave-AI/claude-skills --skill database-migrator -a claude-code, then check ~/.claude/skills/database-migrator/SKILL.md.
What does database-migrator do?
It moves schemas, data, and database logic between PostgreSQL, MySQL, Supabase, PlanetScale, and MongoDB. It produces migration scripts, validation queries, rollback steps, and migration-plan.md.
Can it migrate a relational database to MongoDB?
Yes, but that path needs schema redesign because the source and target use different data models. It is more than a SQL dialect conversion.
Source text
SKILL.md · MIT
--- name: database-migrator description: Migrates databases between providers (Postgres, MySQL, Supabase, PlanetScale, MongoDB). Reads source schema, generates migration scripts, handles data type mapping, foreign keys, indexes, triggers, stored procedures. Validates migration with row counts and checksums. Generates migration-plan.md with step-by-step execution guide, rollback procedures, estimated downtime. tools: Read, Write, Bash, Glob, Grep, Agent user_invocable: true --- # Database Migrator Move schemas, data, and logic between database providers. This is a cross-provider migration engine, not a schema designer: it handles data type incompatibilities, provider-specific SQL dialects, foreign key ordering, sequence and auto-increment translation, trigger rewrites, and stored procedure conversion. It validates with row counts and checksums and produces an auditable migration-plan.md. ## Contents - references/schema-discovery.md -- Extraction queries for relational, MongoDB, Supabase, and PlanetScale sources. - references/type-mapping.md -- Data type maps (PG/MySQL/Mongo) and SQL function translation. - references/script-generation.md -- DDL, sequence, trigger, procedure, and view translation. - references/data-migration.md -- Export, transform, and import commands per provider. - references/validation.md -- Row count, checksum, FK integrity, index, and spot-check queries. - references/rollback-and-downtime.md -- Rollback scripts, backup/restore, downtime estimation. - references/migration-plan-template.md -- Full migration-plan.md output template. - references/edge-cases.md -- Large tables, lossy mappings, document flattening, multi-schema, quality checklist. ## Supported Paths and Complexity Supported source/target pairs: PostgreSQL, MySQL, Supabase (Postgres), PlanetScale (MySQL), and MongoDB, in any direction. - Low: Same underlying engine (e.g., Postgres to Supabase). Mostly connection and permission changes. - Medium: Same paradigm, different dialect (e.g., Postgres to MySQL). Requires type mapping and dialect translation. - Medium-High: Different dialect plus provider constraints (e.g., PlanetScale has no database-level foreign keys). - High: Paradigm shift (e.g., relational to document). Requires schema redesign, not just translation. ## When to Use - Moving a production database from one provider to another. - Migrating between self-hosted and managed services. - Replicating a schema across providers for multi-cloud or disaster recovery. - Consolidating multiple databases into a single provider. - Translating a complete data model between relational and MongoDB. - Producing a validated, auditable migration plan before executing in production. ## When NOT to Use - Designing a new schema from scratch (use database-schema-designer). - Migrating application code between frameworks (use full-codebase-migrator). - Changing a few columns or adding one table (write the ALTER statements directly). - Real-time replication or CDC -- this skill generates point-in-time scripts, not streaming pipelines. ## Workflow Follow these steps precisely when this skill is invoked. 1. Gather migration parameters. Establish: source provider and version; target provider and version; connection method (live or dump file); schema scope (which schemas/tables); data migration (schema only or schema + data, full or partial); downtime tolerance; data volume; application dependencies; and output location (default to current directory). If the user already supplied these, skip the questions and proceed. 2. Discover the source schema. Extract tables, columns, types, defaults, constraints, indexes, foreign keys, triggers, procedures, functions, views, sequences, enums, and row counts. For MongoDB, scan collections to infer schema. For Supabase, also extract RLS policies, extensions, and publications. See references/schema-discovery.md. 3. Map data types. Translate every source type to the best target type and flag lossy or precision-changing conversions. Translate provider-specific SQL functions. See references/type-mapping.md. 4. Generate schema scripts. Resolve table creation order by topological sort (defer cyclic foreign keys). Generate DDL, translate sequences/auto-increment, rewrite triggers and stored procedures, and translate views. See references/script-generation.md. 5. Generate data migration scripts. Produce export, transform, and import commands for the source and target providers. See references/data-migration.md. 6. Generate the validation plan. Produce row count, checksum, foreign key integrity, index, trigger/procedure, and sample data spot-check queries for source and target. See references/validation.md. 7. Generate the rollback plan and downtime estimate. Produce reverse-order DROP scripts, backup/restore commands, application rollback steps, and a phased downtime estimate with reduction strategies. See references/rollback-and-downtime.md. 8. Generate migration-plan.md. Assemble the executive summary, scope, schema inventory, type mapping, incompatibilities, scripts, validation, rollback, downtime, risk assessment, checklists, step-by-step execution guide, and required application changes. Use the template in references/migration-plan-template.md. 9. Handle edge cases. Account for extremely large tables, lossy mappings, MongoDB document flattening, PlanetScale foreign key workarounds, Supabase specifics, and multi-schema migrations. Verify the plan against the quality checklist. See references/edge-cases.md.
© OneWave-AI · MIT · OneWave-AI/claude-skills