From c76fbb5b61bf1e7335b8035ad821212dcf76722a Mon Sep 17 00:00:00 2001 From: Corey McCormick Date: Thu, 11 Aug 2022 06:35:46 -0400 Subject: [PATCH] Allow for proper database resolve with schemas (#1349) * Allow for proper database resolve with schemas * Remove need to explode database and table name --- src/Console/ModelsCommand.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Console/ModelsCommand.php b/src/Console/ModelsCommand.php index 963409b..97fa6c0 100644 --- a/src/Console/ModelsCommand.php +++ b/src/Console/ModelsCommand.php @@ -463,6 +463,7 @@ class ModelsCommand extends Command */ public function getPropertiesFromTable($model) { + $database = $model->getConnection()->getName(); $table = $model->getConnection()->getTablePrefix() . $model->getTable(); $schema = $model->getConnection()->getDoctrineSchemaManager(); $databasePlatform = $schema->getDatabasePlatform(); @@ -482,11 +483,6 @@ class ModelsCommand extends Command $databasePlatform->registerDoctrineTypeMapping($yourTypeName, $doctrineTypeName); } - $database = null; - if (strpos($table, '.')) { - [$database, $table] = explode('.', $table); - } - $columns = $schema->listTableColumns($table, $database); if (!$columns) {