Skip to content

Unknown database type "geometry" requested, Doctrine\DBAL\Platforms\PostgreSQL120Platform may not support it. #456

@Kinqdos

Description

@Kinqdos

Hello there I am trying to use the PostGIS types. Especially the type geometry. I use symfony and added the following to the doctrine.yaml:

doctrine:
...
        types:
            geometry: MartinGeorgiev\Doctrine\DBAL\Types\Geometry

then a I added a column with

    #[ORM\Column(type: 'geometry', nullable: true)]
    public ?WktSpatialData $coordinates = null;

but when I run php bin/console schema:update --dump-sql I get the following error

/var/www/html # bin/console doc:schema:update --dump-sql

In AbstractPlatform.php line 408:
                                                                                                                 
  Unknown database type "geometry" requested, Doctrine\DBAL\Platforms\PostgreSQL120Platform may not support it.  
                                                                                                                 

doctrine:schema:update [--em EM] [--complete] [--dump-sql] [-f|--force]

Additionally I want to ask, if there is a way to specify this type a bit more. In raw sql I want geometry(Point, 4326). But I did not find any options for something like this.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions