activerecord-postgis-adapter
activerecord-postgis-adapter copied to clipboard
Does not dump virtual / generated / stored columns correctly
Whatever they're called, when using the postgis adapter with Rails 7 virtual columns don't get dumped correctly leading to an invalid schema.
- t.virtual "popularity", type: :string, as: "1", stored: true
+ t.string "popularity", default: -> { "1" }
I just released version 8.0.1 which includes this PR (https://github.com/rgeo/activerecord-postgis-adapter/pull/360) that I believe resolves this issue. Let me know if it doesn't.
Hello, I’m having some troubles specifically with virtual geometry columns in the generated schema.rb
The migration works fine with limit: "geometry, 3857"
But I get something like
t.virtual "geom_web_mercator", type: :geometry, limit: {:srid=>0, :type=>"geometry"}, as: "st_transform(geom, 3857)", stored: true
So when doing a rails db:reset
I have the following error:
ActiveRecord::StatementInvalid: PG::SyntaxError: ERROR: syntax error at or near "{"
LINE 1: ...:geography)) STORED, "geom_web_mercator" geometry({:srid=>38...
Version 8.0.2 includes the fix for virtual geometry columns.