-
Notifications
You must be signed in to change notification settings - Fork 1
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
Doctrine - Unknown database type citext #2
Comments
Is there an issue with the migration, or is this error occurring somewhere else? I did not have any issues running that migration. Can you show the code that is causing the error? Thanks. |
Default Doctrine platForm definition for PostgreSql doesn't describe CITEXT field type.
|
Don't forget to install citext in postgresql.
|
Not sure if your issue was solved, but for others having this issue, check out this fix for the latest version of Doctrine: https://github.com/evy0311/dbal |
@evy0311 Using a fork just for this is overkill in my opinion, Doctrine allows extending its functionality well enough that the custom code necessary could be implemented with just a composer package. The code provided in #2 (comment) combined with these lines should be sufficient to add use App\DoctrineExtensions\DBAL\Types\Citext;
use Doctrine\DBAL\Types\Type;
Type::addType(Citext::CITEXT, Citext::class);
$doctrine_dbal_connection->getDatabasePlatform()->registerDoctrineTypeMapping('citext', Citext::CITEXT); Making a static class method or a function with the above code that can be ran by the user before any DBAL code is ran (which would otherwise complain about the |
I encountered the same problem, the problem is that Laravel and also Doctrine Dbal just don't have support for some PostgreSQL specific data types, the Citext extension was just the tip of the iceberg of problems for me. So if someone has the problem again and ends up here via Google, I have introduced Laravel to the Citext extension and many more and will now gradually implement even more PostgreSQL specific functionalities: |
I'm getting an error:
[Doctrine\DBAL\DBALException] Unknown database type citext requested, Doctrine\DBAL\Platforms\PostgreSqlPlatform may not support it.
Not sure how to troubleshoot this. Can you point me in the right direction? Here's my migration file:
The text was updated successfully, but these errors were encountered: