darryldecode's avatar

[L5] Why some migrations CLI API removed??

There are very useful cli migration api options that are very important, like the --path="some path here to process migration". This has been remove in make:migrate and migrate commands. But why?? This options are very useful in a very large applications mostly in multi-tenant apps and also this is very handy tool when you have segregated your components into modules with separate migrations. I know we can change the migration path in config but it would be too cumbersome specially if you want just to automate things. Or am I missing something?

0 likes
3 replies
jeja2000's avatar

I agree to that, Now that I am realizing the fact I am in need to create own make:migration and migrate wrappers.

I cant see why it is removed, I am totally on your line with multi-tenant apps.

RemiC's avatar

I can totally see why it was removed, as its usage could be confusing, like when running migrate:refresh custom migration paths would be rolled back but without being migrated thereafter, which was odd (not to say a workflow killer...)

But as for L5 packages, I definitely agree it needs a replacement solution.

martinbean's avatar

The problem with specifying paths for migrations is, once you’ve ran the migration, if you then try to roll back that migration, Laravel doesn’t know if it’s looking in your app’s database/migrations directory, or some other directory, and at this point you’ll get a file not found exception if it’s in a custom location.

I’m building a modular CMS and have opted to use a separate tool for migrations (Phinx). It stores package-specific migrations in a custom table (migrations_events, migrations_news etc) so I can run or roll back each packages’ migrations individually.

1 like

Please or to participate in this conversation.