ksassnowski/venture

Disable automatic migrations

Closed this issue · 4 comments

I'm using Venture in a multi tenancy application and thus have published the migrations, so that I can run Venture's migrations both for the system/landlord connection as well as for each tenant (each tenant has its own database).

I'm running into class name redeclarations as Venture automatically runs migrations.
I'd prefer a config key to disable automatic migration by the package that you can use when you've published the migrations for any customisation, or if you're like me, prefer to have all migrations in the migration directory without packages magically injecting them.

Would you be open to a PR that adds a config key skip_migrations defaulting to false?

That sounds like a good idea, but I wonder if there is a "nicer" way to do this. Maybe it's possible to automatically detect if the migrations have been published. And if so, don't register them again 🤔 Not sure if this is even possible, however.

That'd be neat.. I'm all for automation :D
I'm not sure if it's possible either. In my case, I published the migrations and have them both in database/migrations as well as database/migrations/landlord to have it migrated on two different connections.

I can't seem to reproduce the problem locally. If I simply publish the migrations, I don't get a class name redeclaration error. Even if I copy and paste them to a landlord folder it still seems to work fine. Is it possible for you to create a minimal repository that reproduces the issue?

I can't seem to reproduce it now in a minimal example either, so I might just have had a moment of stupidity before the weekend.
I've also refactored some of my project code since opening the issue, so it might just have been a bug in my app 🤷‍♂️
Anyway, I'm not experiencing this problem atm, and cant reproduce it either myself, so I'll just close this for now.