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

Support for Postgresql hstore. #189

Open
pc-magas opened this issue Jul 3, 2019 · 1 comment
Open

Support for Postgresql hstore. #189

pc-magas opened this issue Jul 3, 2019 · 1 comment

Comments

@pc-magas
Copy link

pc-magas commented Jul 3, 2019

In my database I utilise the hstore extention. In that database I need to create migration scripts.

But when I generate the migration script via the command:

php artisan migrate:generate

I get the following error:

   Doctrine\DBAL\DBALException  : Unknown database type hstore requested, Doctrine\DBAL\Platforms\PostgreSQL94Platform may not support it.

  at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php:434
    430| 
    431|         $dbType = strtolower($dbType);
    432| 
    433|         if (! isset($this->doctrineTypeMapping[$dbType])) {
  > 434|             throw new DBALException('Unknown database type ' . $dbType . ' requested, ' . static::class . ' may not support it.');
    435|         }
    436| 
    437|         return $this->doctrineTypeMapping[$dbType];
    438|     }

  Exception trace:

  1   Doctrine\DBAL\Platforms\AbstractPlatform::getDoctrineTypeMapping("hstore")
      /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php:363

  2   Doctrine\DBAL\Schema\PostgreSqlSchemaManager::_getPortableTableColumnDefinition()
      /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php:804

On the other hand there are plugins to handle the hstore:

Also there's support for hstore for doctrine as well: https://github.com/opsway/doctrine-dbal-postgresql

Therefore is there a way to allow the generator to let it utilize the 3rd party plugins for hstore or natively let it handle?

IMHO I think is good idea for somehow this plugin to load 3rd party plugins in order to be able to handle custom data types or even custom plugins for various databases.

@rishpandey
Copy link

rishpandey commented Dec 8, 2020

Did you manage to solve this? I have a similar issue.

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