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

Doctrine type "json_collection" and diff #140

Closed
notFloran opened this issue Jun 24, 2021 · 1 comment · Fixed by #141
Closed

Doctrine type "json_collection" and diff #140

notFloran opened this issue Jun 24, 2021 · 1 comment · Fixed by #141

Comments

@notFloran
Copy link
Contributor

I try to use the json_collection type (https://github.com/Elao/PhpEnums#in-a-symfony-app) : it works well but doctrine: migration: diff offers me the same migration permanently.

While digging a little I came across this issue : https://github.com/dunglas/doctrine-json-odm/pull/43/files

So I try to add requiresSQLCommentHint to AbstractJsonCollectionEnumType :

abstract class AbstractJsonCollectionEnumType extends JsonType
{
    // ...

    public function requiresSQLCommentHint(AbstractPlatform $platform)
    {
        return true;
    }
}

And it works.

@ogizanagi
Copy link
Member

Hmm, the Doctrine JsonType defines it differently according to the platform, depending on if it has native support for a json type or not. So I guess you're using PostgreSQL.
I'm not aware of any drawbacks of overwriting it for custom types though, so let's add it.

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

Successfully merging a pull request may close this issue.

2 participants