rgeo / activerecord-mysql2spatial-adapter

ActiveRecord connection adapter for MySQL Spatial Extensions, based on mysql2 and rgeo
48 stars 64 forks source link

Cannot dump geometry into schema.rb #9

Closed ronna-s closed 9 years ago

ronna-s commented 10 years ago

rake db:schema:dump generates error:

# Could not dump table <NAME> because of following StandardError
# Unknown type 'geometry' for column 'borders'
ronna-s commented 10 years ago

I solved this problem by implementing ActiveRecord::SchemaDumper#table and adding ActiveRecord::ConnectionAdapters::TableDefinition#geometry. But the problem and the solution is coupled with rgeo-activerecord gem. So I'm not sure how and where to submit my code.

See patch here: https://gist.github.com/ronna-s/9199122

januszm commented 9 years ago

Resolved in #15

DhawalSawla commented 6 years ago

May I know how to solve this error?

januszm commented 6 years ago

Are you using ActiveRecord 4.1? Because this gem is unfortunately compatible only with older ActiveRecord 4 @DhawalSawla

DhawalSawla commented 5 years ago

@januszm Sorry for the late reply. I am using ActiveRecord 4.2. The issue is not while generating the schema file. The migration happens correctly and I see this error in the schema file.

Could not dump table "offer_v2_locations" because of following StandardError

Unknown type 'geometry' for column 'geom'

Since the migration is done without any blocker, I ignore this.

But when I deploy to the codeship, the codeship does not create the offer_v2_locations model since this model is not created in the schema file.

I need to know how to create the model in the schema file so that on codeship, i can run my test cases.