Skip to content

Commit 5fceeed

Browse files
committed
Use the default connection and check for MySQL driver
1 parent af349d7 commit 5fceeed

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/Console/DbUpgradeCommand.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,12 +363,27 @@ protected function checkExistingDatabase(): void
363363
}
364364
}
365365

366+
/**
367+
* @return string
368+
*/
369+
protected function getDatabaseConnection(): string
370+
{
371+
return config('database.default');
372+
}
373+
366374
/**
367375
* @return array
368376
*/
369377
protected function getDatabaseConfig(): array
370378
{
371-
return config('database.connections.mysql');
379+
$config = config('database.connections.' . $this->getDatabaseConnection());
380+
$driver = $config['driver'] ?? null;
381+
382+
if ($driver !== 'mysql') {
383+
throw new DbUpgradeException('Only driver MySQL is supported.');
384+
}
385+
386+
return $config;
372387
}
373388

374389
/**

0 commit comments

Comments
 (0)