💙 Supporting healthcare non-profits: Metadataloop is free for 6–12 months. Contact Us to get started.
Developer Utility

Migration Script Generator

Paste your CURRENT and TARGET schemas — get an ALTER TABLE migration script tailored to your dialect. Detects added / removed / modified columns and new or dropped tables.

Dialect
Current Schema (FROM)
Target Schema (TO)
Generated Migration Script
-- Output will appear here.

Diff two schemas, get a ready-to-run migration script

Manually writing ALTER TABLE statements for every schema change is slow and error-prone. Paste your "before" and "after" schema and the Migration Generator diffs them and emits the exact ALTER / CREATE / DROP statements needed to get from one to the other, in your target dialect.

What it detects

  • New tables: emitted as full CREATE TABLE statements.
  • Removed tables: emitted as DROP TABLE statements.
  • Added/removed columns: emitted as ALTER TABLE ... ADD COLUMN / DROP COLUMN.
  • Changed columns: type, nullability, or default changes become ALTER TABLE ... MODIFY/ALTER COLUMN, dialect-specific.

Common use cases

Release migration scripts

Generate the exact DDL to ship alongside a feature branch's schema changes.

Environment drift fixes

Diff staging vs. production schema exports and generate a reconciliation script.

Cross-dialect migrations

Generate target-dialect-correct ALTER statements when moving between engines.

Code review for schema PRs

Confirm a PR's migration matches the intended before/after schema diff.

FAQ

What changes does it detect? Added and removed tables, added and removed columns, and column type/constraint changes between the "before" and "after" schema you paste in.

Which dialects can it generate migrations for? PostgreSQL, MySQL, Snowflake, and SQL Server — pick the target dialect and the ALTER/CREATE/DROP syntax matches it.

Is the generated script safe to run as-is? Always review generated DROP and ALTER statements before running them against production — especially column drops and type narrowing, which can be destructive.

Can I download the migration script? Yes — use the Download .sql button to save the generated migration directly.

⚠ Confirm Delete