From 62fc436c4cadf1e949fcc5a632cc1c3e7d6d29dc Mon Sep 17 00:00:00 2001 From: Ben Poulson Date: Wed, 7 Feb 2024 20:55:16 +0000 Subject: [PATCH] Reintroduce support for multi-db setups (#1426) This snipet was lost in the 2.12.x => 2.13.x change. Needs to be reintroduced to allow those who use fully qualified db+table names. (Eg, `database.table`) --- src/Console/ModelsCommand.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Console/ModelsCommand.php b/src/Console/ModelsCommand.php index a2439b1..42dfc95 100644 --- a/src/Console/ModelsCommand.php +++ b/src/Console/ModelsCommand.php @@ -510,6 +510,10 @@ class ModelsCommand extends Command $schema = $model->getConnection()->getDoctrineSchemaManager(); $databasePlatform = $schema->getDatabasePlatform(); $databasePlatform->registerDoctrineTypeMapping('enum', 'string'); + + if (strpos($table, '.')) { + [$database, $table] = explode('.', $table); + } $platformName = $databasePlatform->getName(); $customTypes = $this->laravel['config']->get("ide-helper.custom_db_types.{$platformName}", []);