In dev and preprod environments, these types were loaded anyway and no error occurred. When we deployed in the production environment, error occurred because these types were not loaded :
Fatal error: Uncaught Doctrine\DBAL\Exception: Unknown column type "geometry" requested. Any Doctrine type that you use has to be registered with
\Doctrine\DBAL\Types\Type::addType(). You can get a list of all the known types with \Doctrine\DBAL\Types\Type::getTypesMap(). If this error occurs
during database introspection then you might have forgotten 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. in
/var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php on line 282
Today, we have defined the types in the doctrine config file, so everything works. But we wanted to give you feedback because if it wasn’t very critical in our case, it could have been.
I think the behavior should be the same on all environments so there are 2 options here :
For all environments, the types aren’t defined, error occurs.
For all environments, the types aren’t defined but are loaded, no error occurs.
In our Symfony instance (5.4) with the 1.8 version of the library, we didn’t define types in config/packages/doctrine.yaml like this :
In dev and preprod environments, these types were loaded anyway and no error occurred. When we deployed in the production environment, error occurred because these types were not loaded :
Today, we have defined the types in the doctrine config file, so everything works. But we wanted to give you feedback because if it wasn’t very critical in our case, it could have been.
I think the behavior should be the same on all environments so there are 2 options here :
By the way, thanks for this great library.