Closed pbrisson closed 3 years ago
Good idea. I'll try tackling this shortly, but happy to accept a PR if you want to contribute a fix!
Good idea. I'll try tackling this shortly, but happy to accept a PR if you want to contribute a fix!
I have added this function in and created a PR
https://github.com/cviebrock/sequel-pro-laravel-export/pull/37
Thanks @rootrus! I did a bit of clean-up and this is now supported in the 2.0.1 release.
When dealing with a large amount of tables, the migrations are created in alphabetical order.
Foreign keys are properly exported in the migrations; however, the fact referenced table exists or not isn't taken in consideration.
If a table named "aaa" references a table named "zzz" on delete cascade, for example, it will fail when you run migrations, since the table "zzz" won't be existing at this point.
I'm wondering if it would be possible to export all foreign keys as a separate migration, after all tables have been processed, when the bundle detects multiple tables are being exported?
I'm using bundle version 1.5.0 with Sequel Pro 1.1.2 version 4541 (602e11a) on MariaDB 10.3.17-MariaDB-0+deb10u1 (Debian 10).