lucasdotvin/laravel-soulbscription

Migrations issue when using in mutli-tenant architecture

FabriceAbbey opened this issue ยท 6 comments

Hi Lucas,

First of all thank you for your amazing package. I am using this package in a saas and the landlord migration runs fine. The problem is when migrating the tenant database it also runs in the tenant db even though it is not needed because of the loadMigrationsFrom in the boot function of the provider. It might be helpful to not call the loadMigrationsFrom and let each user publish the migration for people that might want to use it in a saas.

Thank you for your time.

Hey! Thanks for contributing! So you think it should disable the migrations loading after they are published? ๐Ÿค˜

Hey! Yes I do think it should disable the migrations loading after they are published.

Perfect! I'm gonna see how we can check if the assets were published and disable the loading in this case. ๐Ÿš€

Hi! I could not find a way to check if the migrations were already published, so in the last release, I created a flag to ignore them: if someone needs to ignore the migrations loading, he can set the config option soulbscription.database.cancel_migrations_autoloading to true and the service provider will not load them by. ๐Ÿค˜

Let me know if it solved your problem and if there is something more I can help you with! ๐Ÿ˜…

Thank you very much. This is very appreciated this solution make sense in case someone doesn't want to disable. Cheers