DevTools Logo

DB Migration Script Generator

DB Migration Script Generator

Compare two CREATE TABLE schemas and generate ALTER, CREATE, and DROP migration SQL.

Quick start

Dialect

About this tool

Compare two database schema snapshots expressed as CREATE TABLE DDL and generate ALTER, CREATE, and DROP migration statements. Supports PostgreSQL, MySQL, and SQLite with explicit warnings when destructive changes are detected.

How to use this tool

  1. Old schema

    Paste the current CREATE TABLE definitions.

  2. New schema

    Paste the target CREATE TABLE definitions after your model changes.

  3. Generate

    Select dialect and copy the migration script after reviewing DROP warnings.

Use cases

Schema review

Preview SQL diffs before applying migrations in staging.

Documentation

Attach generated scripts to pull requests describing database changes.

Frequently asked questions

Does this tool connect to my database?

No. It compares two DDL schema texts locally and generates migration SQL. Nothing is executed against a live database.

Which dialects are supported?

PostgreSQL, MySQL, and SQLite CREATE TABLE syntax. Complex vendor-specific features may need manual review after generation.

Why are DROP statements highlighted?

Dropping tables or columns is destructive and irreversible. The tool flags DROP operations so you review them before running migrations in production.