You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This results in Schema using the connection that the DB manager uses when Schema is first called.
// change DB connection from default to foo
Schema::getConnection()->getName(); // => foo// change the DB connection back
Schema::getConnection()->getName(); // => foo
Schema remembers the connection that was used when it was first initialized.
In 5.7 Schema used the current DB connection, which I believe is more correct.
On line 34 Schema is first initialized and remembers that the sqlite connection is used and on line 36, when the DB manager uses the tenant connection, Schema still uses the sqlite connection.
Steps To Reproduce:
You can try to turn my pseudocode into code or you can play with my package:
cd /tmp
git clone https://github.com/stancl/tenancy/
cd tenancy
git checkout f9a819215f7350bc3aec869cf7da687cd53bfcbc
composer install
phpunit --filter migrate_command_works_with_tenants_option
and look at the migrate_command_works_with_tenants_option method in tests/CommandsTest.php