laravel-postgresql-enhanced icon indicating copy to clipboard operation
laravel-postgresql-enhanced copied to clipboard

Bug: Exception: Unknown database type citext requested, Doctrine\DBAL\Platforms\PostgreSQL100Platform may not support it.

Open patrickcurl opened this issue 1 year ago • 0 comments

When running composer update which regenerates ide-helper stubs, I go this as it was analyzing the models.

Exception: Unknown database type citext requested, Doctrine\DBAL\Platforms\PostgreSQL100Platform may not support it.
Could not analyze class App\Models\Tag.

The fix was easy enough, in AppServiceProvider I put:

<?php
// ...
use Tpetry\PostgresqlEnhanced\Types\CitextType;
class AppServiceProvider extends ServiceProvider
{
...
    public function boot(){
        \app('db')->registerDoctrineType(CitextType::class, 'citext', 'string');
        // ...
    }

As I was looking at the code in the vendor folder, I noticed the $typeInstance->getName() is deprecated in doctrine, not sure if that is related,and I'm not sure that's the best way to register the doctrine type, but it made the error go away..

patrickcurl avatar Sep 15 '22 06:09 patrickcurl