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`)
This commit is contained in:
Ben Poulson
2024-02-07 21:55:16 +01:00
committed by GitHub
parent 409bbf665b
commit 62fc436c4c
+4
View File
@@ -510,6 +510,10 @@ class ModelsCommand extends Command
$schema = $model->getConnection()->getDoctrineSchemaManager(); $schema = $model->getConnection()->getDoctrineSchemaManager();
$databasePlatform = $schema->getDatabasePlatform(); $databasePlatform = $schema->getDatabasePlatform();
$databasePlatform->registerDoctrineTypeMapping('enum', 'string'); $databasePlatform->registerDoctrineTypeMapping('enum', 'string');
if (strpos($table, '.')) {
[$database, $table] = explode('.', $table);
}
$platformName = $databasePlatform->getName(); $platformName = $databasePlatform->getName();
$customTypes = $this->laravel['config']->get("ide-helper.custom_db_types.{$platformName}", []); $customTypes = $this->laravel['config']->get("ide-helper.custom_db_types.{$platformName}", []);