Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

dn.marques's avatar

How to replace package that runs migrations?

Hello everybody,

Recently I've been upgrading from laravel 5.1 to laravel 5.4. This requires to remove the package lucadegasperi/oauth2-server-laravel and replace it with laravel/passport for oauth2 authentication.

The problem here is that lucadegasperi package generated migrations that I need to rollback before running the migrate command after installing passport (because they share some table names, like oauth_clients).

I dived into passport migrations and found a workaround which is to manually create a migration that invert lucadegasperi migrations (up method goes to down method and vice-versa) and rename that migration to 2016_05_31_xxxxxx, so it runs before passport migrations, but that just sounds like a lot of work, duplicated code, and migration name won't match it's creation time.

Is there any alternative?

Thanks!

0 likes
2 replies

Please or to participate in this conversation.