Skip to content

Commit

Permalink
fix: Update TableFieldsGenerator.php (#1084)
Browse files Browse the repository at this point in the history
* Update TableFieldsGenerator.php

/**
         * For Avoiding
         * Doctrine\DBAL\Exception
         *
         * Unknown database type enum requested, Doctrine\DBAL\Platforms\MySQL80Platform may not support it.
         */

* Update TableFieldsGenerator.php

Fix --fromTable enum datatype problem
  • Loading branch information
ringkubd authored Jan 4, 2024
1 parent a05bf0f commit b13c1c3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Utils/TableFieldsGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,16 @@ public function __construct($tableName, $ignoredFields, $connection = '')
'bit' => 'boolean',
];

$this->tableDetails = $this->schemaManager->listTableDetails($this->tableName);
// $this->tableDetails = $this->schemaManager->listTableDetails($this->tableName);

$mappings = config('laravel_generator.from_table.doctrine_mappings', []);
$mappings = array_merge($mappings, $defaultMappings);
foreach ($mappings as $dbType => $doctrineType) {
$platform->registerDoctrineTypeMapping($dbType, $doctrineType);
}

// Added
$this->tableDetails = $this->schemaManager->listTableDetails($this->tableName);

$columns = $this->schemaManager->listTableColumns($tableName);

$this->columns = [];
Expand Down

0 comments on commit b13c1c3

Please sign in to comment.