rgeo/activerecord-postgis-adapter

Change column type in migration with change_column throws PG syntax error

Closed this issue · 1 comments

I'm having trouble changing a MultiPolygon column type to a Geometry type:
geometry(MultiPolygon,26986) -> geometry(Geometry,26986)

In my migration I have this:
change_column :schools, :shed_05, :geometry, srid: 26986, geographic: false

Which throws this syntax error:

ActiveRecord::StatementInvalid: PG::SyntaxError: ERROR:  syntax error at or near ")"
LINE 1: ALTER TABLE "schools" ALTER COLUMN "shed_05" TYPE geometry()
                                                                   ^
: ALTER TABLE "schools" ALTER COLUMN "shed_05" TYPE geometry()

How do I create a migration that changes the column type from MultiPolygon to Geometry?

Thanks!

This is fixed in the current version.