While playing around with SonataUserBundle and FOSUserBundle I quickly found out that I had to remove both of them. Long story short, it seems that one of them is not yet supporting the latest version of the other.

 

Sadly, when trying to update the doctrine schema with

php app/console doctrine:schema:update --dump-sql

or

php app/console doctrine:schema:update --force

this pesky error popped up:

[DoctrineDBALDBALException]
Unknown column type "json" requested. Any Doctrine type that you use has to be registered with DoctrineDBALTypesType::addType(). You can get a list of all the known types with DoctrineDBALTypesType::getTypeMap(). If this error occurs during database introspection then you might have forgot to register all database types for a Doctrine Type. Use AbstractPlatform#registerDoctrineTypeMapping() or have your custom types implement Type#getMappedDatabaseTypes(). If the type name is empty you might have a problem with the cache or forgot some mapping information.

 

After rewinding all config changes made by the installation of those two bundles, the error was still there. So, the first step into finally fixing the problem was to remove these lines from config.yml:

dbal:
        types:
            json: SonataDoctrineTypesJsonType

And then, after a lot of forums research, web searching and so on, I found out that SonataUserBundle and FOSUserBundle both added several tables in the database. These always start with fos_* or acl_*  and removing them finally made things work as before.

 

I used to think it’s all about configs, but apparently there is a reference to this data type in the DB itself. It took me a while to figure this out and I really hope it helps. Cheers!

Privacy Preference Center