Generate database migrations from a diagram
Edit the diagram, and DesignDB writes the SQL that brings a database from how it is now to how the diagram says it should be, with a roll back script and notes about anything risky.
How it works
- Paste the schema your database has now (for PostgreSQL, the output of pg_dump --schema-only).
- DesignDB compares it with your diagram, matching objects by name.
- You get an upgrade script and a roll back script, with notes in three levels: data loss or a manual step, can fail on existing rows, and information.
In the format your tool reads
Download the files laid out for Flyway, Liquibase, Atlas, golang-migrate, dbmate, Prisma Migrate, Drizzle Kit, Alembic, Rails or Django, each with a note on where to put them and the command to run.
Plans
Migrations are part of Pro, along with importing and exporting every other format. The editor, with the diagram, is free in your browser.
Schemas to start from
Questions
Does it need access to my database?
No. You paste the schema text; DesignDB never connects to your database.
How does it treat renames?
Objects are matched by name, so a rename shows as a drop and an add. The notes say so, because that can lose data; version history compares saved versions in a way that keeps renames as renames.