Skip to content

Commit 2158a39

Browse files
SimplyCoreyd3v2a
authored andcommitted
Allow for proper database resolve with schemas (barryvdh#1349)
* Allow for proper database resolve with schemas * Remove need to explode database and table name
1 parent 8f4b56e commit 2158a39

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/Console/ModelsCommand.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,7 @@ protected function getTypeOverride($type)
463463
*/
464464
public function getPropertiesFromTable($model)
465465
{
466+
$database = $model->getConnection()->getName();
466467
$table = $model->getConnection()->getTablePrefix() . $model->getTable();
467468
$schema = $model->getConnection()->getDoctrineSchemaManager();
468469
$databasePlatform = $schema->getDatabasePlatform();
@@ -482,11 +483,6 @@ public function getPropertiesFromTable($model)
482483
$databasePlatform->registerDoctrineTypeMapping($yourTypeName, $doctrineTypeName);
483484
}
484485

485-
$database = null;
486-
if (strpos($table, '.')) {
487-
[$database, $table] = explode('.', $table);
488-
}
489-
490486
$columns = $schema->listTableColumns($table, $database);
491487

492488
if (!$columns) {

0 commit comments

Comments
 (0)