mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-03 12:54:36 -04:00
Fixes for multi db migration
This commit is contained in:
parent
ff6f66e5c5
commit
6854c6c1f9
@ -49,19 +49,26 @@ class DesignUpdate extends Command
|
|||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
|
//always return state to first DB
|
||||||
|
|
||||||
|
$current_db = config('database.default');
|
||||||
|
|
||||||
if (! config('ninja.db.multi_db_enabled')) {
|
if (! config('ninja.db.multi_db_enabled')) {
|
||||||
$this->handleOnDb();
|
$this->handleOnDb();
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
//multiDB environment, need to
|
//multiDB environment, need to
|
||||||
foreach (MultiDB::$dbs as $db) {
|
foreach (MultiDB::$dbs as $db) {
|
||||||
MultiDB::setDB($db);
|
MultiDB::setDB($db);
|
||||||
|
|
||||||
$this->handleOnDb($db);
|
$this->handleOnDb($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MultiDB::setDB($current_db);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function handleOnDb()
|
private function handleOnDb()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user