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 text[] requested, Doctrine\DBAL\Platforms\PostgreSQL100Platform may not support it. #73

Open
mathroc opened this issue Jul 29, 2020 · 2 comments

Comments

@mathroc
Copy link

mathroc commented Jul 29, 2020

I was already using this extension for some functions and tried using the text[] type but doctrine thrown this exception when I tried to use it in an entity.

I was able to fix that by extending TextArray and adding this method:

    /**
     * @return array<string>
     */
    public function getMappedDatabaseTypes(AbstractPlatform $platform): array
    {
        return [self::TYPE_NAME];
    }

is there something wrong with my config ? or maybe that’s something caused by the latest version of doctrine ? if not do you think this method should be added to BaseType ?

doctrine/dbal: 2.10.2
doctrine/orm: 2.7.3
doctrine/doctrine-bundle: 2.1.0
symfony: 5.1.*

@mathroc
Copy link
Author

mathroc commented Jul 30, 2020

I just realized that it’s very probably because I missed the mapping_types config

while this solves my issue without having to extend the class, it would be nice to implement getMappedDatabaseTypes to avoid having to add this configuration in the first place

feel free to close this issue if you’d rather keep it as it is !

@martin-georgiev
Copy link
Owner

I think the package can make use of some modernisation for most recent Doctrine versions. Would you be able to help with opening a PR for getMappedDatabaseTypes, please?

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

No branches or pull requests

2 participants