Open PiranhaGeorge opened 6 years ago
We used to have a separate connection name for migrations, but in discussions with @Thijmen we decided to drop it assuming migrations would only be ran inside artisan anyway..
I think we should consider restoring that migration connection name, I would love to hear your opinions.
@luceos, what if we just change it so tenant commands restore the previous state after running. So if the command needs to change to the tenant DB, then it should cache the old setting, and restore it once done. This should minimize any side-effects these commands may have, and simplify the config so it doesn't need extra connections
Hi,
Just found a sneaky bug.
The
tenancy:migrate
command changes the default connection to tenant. This isn't a problem when using the command in the terminal, however, as it is also called from Connection::migrate(), creating a website changes the default database.This is a huge issue for me as I'm changing the default connection via middleware so that I can use laravel passport for system and tenant apis.
I should get a chance to put in a pull request next week, unless someone else can do so sooner.
Cheers, George