Closed vincentkedison closed 3 years ago
Hey, this is a good idea, but one thing is that migration files are run before the automatic migrations.
The sequence would not accomodate for this, right? Also, are you coupling all your DB tables with models? Or using a mixture of files and models?
I'm gonna merge and tweak this, I think it's a good idea regardless.
This has been released under v 2.4.0
. Only thing was I changed it to migrationOrder
, hope that is ok.
Added info to readme here: https://github.com/bastinald/laravel-automatic-migrations#migration-order
Thank you.
Hello @bastinald,
Thanks a lot for this awesome package. I'm Vincent from Indonesia, I recently explored your laravel-livewire-ui package. However I found a problem whenever I create migration for a table that has a foreign to other tables. An error would occurred because the migration of related table run before the foreign table exist:
I tried to make some modification by sorting the model files using defined $migration_sequence variable. Using this variable, we can defined the migration running sequence.
If you think this is a good solution, you can freely accept this PR.
Thanks.