Tools: StackRender V1.1.0 is out: Generate Database Migrations from ER Diagram Changes

Tools: StackRender V1.1.0 is out: Generate Database Migrations from ER Diagram Changes

Source: Dev.to

1 . How it works ## 2 . Migrations include UP + DOWN scripts ## 3 . Visual-first vs Code-first database migrations ## 4 . What can it handle? Schema evolution is still one of the most painful parts of backend/database development. I tried multiple tools and workflows (ORM auto-migrations, schema diff tools, etc.), but most of them either add complexity, or hit limitations where you eventually end up writing migrations manually anyway , especially when you care about safe production changes. So I started building a tool around a simple idea: Design your database as an ER diagram, track diagram changes over time, and automatically generate production-ready migrations from the diff. I like to call this approach visual-first database migrations. Each generated migration contains two scripts: Migration up script : Migration rollback script : Most code-first migration tools (like Node.js ORMs such as Prisma, Sequelize, Drizzle, etc.) infer schema changes from code. That approach works well up to a point, but it can struggle with more complex schema changes. For example: StackRender’s visual-first approach uses a state-diff engine to detect schema changes accurately at the moment you make them in the diagram, and generates the correct migration steps. ✅ Relationship changes ✅ Postgres types (ENUMs) If you’re working with Postgres or MySQL, I’d love for you to try it out. And if you have any feedback , I’m all ears 🙏 Try it free online: stackrender.io GitHub: github.com/stackrender/stackrender Schema change complete guide for developers : Guide Much love ❤️ , Thank you! Templates let you quickly answer FAQs or store snippets for re-use. Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink. Hide child comments as well For further actions, you may consider blocking this person and/or reporting abuse - You start with an empty diagram (or import an existing database). - StackRender generates the base migration for you, deploy it and you're done. - Later, whenever you want to update your database, you go back to the diagram and edit it (add tables, edit columns, rename fields, add FK constraints, etc). - StackRender automatically generates a new migration containing only the schema changes you made. Deploy it and keep moving. - UP → applies the changes and moves your database forward - DOWN → rolls back your database to the previous version - ❌ Some tools may not reliably detect column renames (often turning them into drop + recreate) - ❌ Some struggle with Postgres-specific operations like ENUM modifications, etc. - Create / drop - Rename (proper rename not drop + recreate) - Create / drop - Data type changes - Alter: nullability, uniqueness, PK constraints, length, scale, precision, charset, collation, etc. - Rename (proper rename not drop + recreate) - Create / drop - FK action changes (ON DELETE / ON UPDATE) - Create / drop - Rename (when supported by the database) - Add/remove indexed columns - Create / drop - Add/remove enum values