mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-13 07:14:04 +00:00
WIP DatabaseManager
This commit is contained in:
parent
ab0a40a17e
commit
04b4e0644f
7 changed files with 27 additions and 11 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue