Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown database type enum requested, Doctrine\DBAL\Platforms\MySQL57Platform may not support it. #1065

Open
gabriellaborghi opened this issue Feb 6, 2023 · 1 comment

Comments

@gabriellaborghi
Copy link

The command:
php artisan infyom:scaffold Questionario --fromTable --table=questionario --primary=que_id --plural=Questionari --connection=checkpoint
works well in 5.4.1 version. Now it doesn't work and shows the error in the object.
at vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php:454
450▕
451▕ $dbType = strtolower($dbType);
452▕
453▕ if (! isset($this->doctrineTypeMapping[$dbType])) {
➜ 454▕ throw new Exception(
455▕ 'Unknown database type ' . $dbType . ' requested, ' . static::class . ' may not support it.'
456▕ );
457▕ }
458▕

  +23 vendor frames

24 artisan:37

@ringkubd
Copy link
Contributor

ringkubd commented Sep 12, 2023

I fixed the issue and created a pull request.
Check this file InfyOm\Generator\Utils\GeneratorForeignKey line number 80.
$this->tableDetails = $this->schemaManager->listTableDetails($this->tableName); initialized before custom doctrine mappings.
Just add this line after mappings loop.

// Removed
        // $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);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants