-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
jsonb type is interpreted as json in doctrine migrations #71
Comments
Sounds like something is missing from the configuration. Can you share your setup, please? |
Here is my config/packages/doctrine.yaml :
And here is a typical field definition inside my entity :
Did I miss something ? |
Did you find what's the problem? |
I tried reproducing this behavior while installing the package. Noticed that the doctrine:
dbal:
mapping_types:
jsonb: jsonb |
Oh interesting !
That's pretty old so I can't remember how I handled it but I'll try to take
a look again and try that soon.
Thanks 👍
Le mar. 22 mars 2022 à 15:41, Sam ***@***.***> a écrit :
… I tried reproducing this behavior while installing the package. Noticed
that the mapping_types section is missing from @vbourdeix
<https://github.com/vbourdeix>'s doctrine config, so I omitted it and the
migration does indeed default to json. Adding the following to
doctrine.yaml fixes it
dbal:
mapping_types:
jsonb: jsonb
—
Reply to this email directly, view it on GitHub
<#71 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAB4AGILDII6O6XJF2OCXNLVBHL2NANCNFSM4NZRRMVQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Had something similar with JSONB columns always showing up in migrations, with a simple fix for posterity: Don't do #[ORM\Column(type: 'json', options: ['jsonb' => true])] do #[ORM\Column(type: 'jsonb')] Or the DBAL JSON type will always be compared to the JSON type here and generate a diff. |
When creating an entity with a jsonb field and generating a migration with doctrine migrations, the migration defines the field as JSON, which forces me to fix that mannually each time I create a migration.
Do you have a way to fix this ?
The text was updated successfully, but these errors were encountered: