Running into the above error while attempting to run doctrine:schema:update
in Symfony.
The error is happening in AbstractPlatform (part of libDoctrinePlatformsAbstractPlatform)
I’m checking and JSON is definitely registered in libDoctrineDBALTypesType.php
abstract class Type
{
const TARRAY = 'array';
const SIMPLE_ARRAY = 'simple_array';
const JSON_ARRAY = 'json_array';
const JSON = 'json';
...
}
Version of MySQL is 5.7.26 so that should be ok (json is a type here)
I’m just trying to figure out a workaround.
I tried adding
doctrine:
dbal:
types:
enum: json
to doctrine.yaml
but that has had no effect. Does anyone know a workaround? I have no idea where the json file is being called…
Edit: I’ve come across a similar situation here but the answer is for Laravel:
"Unknown database type json requested, DoctrineDBALPlatformsMySQL57Platform may not support it." while running php artisan migrate command
Does anyone have any idea how to implement this for Symfony?
4
Answers
For those interested, here's a hackish workaround I came across here https://github.com/doctrine/orm/issues/6540
In AbstractPlatform, I just modified the error check to convert json files into strings. Not ideal, but it got past this error.
how about
make sure your dbal config is pointing at the correct server version:
For me the fix was a
composer update
from a minor version to an other so it was a bug in the Doctrine DBAL.