nWidart / laravel-modules

Module Management In Laravel
https://docs.laravelmodules.com
MIT License
5.56k stars 969 forks source link

Migration priority ignored when using artisan migrate #1865

Closed danilogiacomi closed 4 months ago

danilogiacomi commented 5 months ago

Hi all, I've read all the issues here, and I understand that the artisan module:migrate command respects the priority set in the module.json files in each module, but when I run the

artisan migrate:fresh

command it also execute the migration from the modules, but then it doesn't respect the priorities and perform them in alphabetical order.

I can't find a configuration to ignore modules migrations when running the global artisan migrate:fresh command, therefore (since some modules migrations have foreign keys to another module table) it fails as it tries to migrate the modules in the "wrong" order.

Is there a way to let the migrate:fresh honor the priorities set in each model or to ignore the models migration at all? (I would then run the module:migrate artisan comand to finish it up)

Thanks!

alissn commented 5 months ago

Hi,

I am currently refactoring this command to improve its functionality and efficiency. If possible, i'll add this option.