I've got a git branch in my project that involves adding and modifying dozens of tables to the project (using MySQL 8.0). They are all built around & interface with tables from a commercial vendor.
The branch is intended to accomplish several things:
- Implement
SoftDeletes and other traits, including wildside/userstamps.
- Apply a complex ownership hierarchy that adds 5 columns to most tables.
- Apply a standardized column order.
- Integrate with
venturedrake/laravel-crm.
- Add a shedload of indexes and foreign keys to existing tables.
- Enforce index and foreign key naming conventions.
I've got the 30 or so new models in place. However, I would like to avoid the tedium of manually writing migrations for even more pre-existing tables.
My schema design workflow leverages the Synchronize Model wizard in MySQL Workbench. The branch's changes are being done in a separate database from my primary workspace (still on my local dev box).
The Workbench wizard can sync either way between ER diagram and (any) database. If updating the database, it presents a collection of ALTER TABLE statements that can be exported.
So, if I sync the pending table changes with my primary workspace DB, I can get a complete set of SQL queries to affect the changes (which I would not execute from the sync wizard).
Is there a package or some other solution that can take this SQL as input and generate the necessary migrations?