1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-13 07:14:04 +00:00

WIP DatabaseManager

This commit is contained in:
Samuel Štancl 2019-09-08 13:46:07 +02:00
parent ab0a40a17e
commit 04b4e0644f
7 changed files with 27 additions and 11 deletions

View file

@ -54,9 +54,8 @@ class Migrate extends MigrateCommand
// See Illuminate\Database\Migrations\DatabaseMigrationRepository::getConnection.
// Database connections are cached by Illuminate\Database\ConnectionResolver.
$connectionName = "tenant{$tenant['uuid']}"; // todo use Illuminate DatabaseManager reconnect()?
$this->input->setOption('database', $connectionName);
$this->database->connectToTenant($tenant, $connectionName);
$this->input->setOption('database', 'tenant');
$this->database->connectToTenant($tenant); // todo test that this works with multiple tenants with MySQL
// Migrate
parent::handle();