postgresql - Rails test database getting wrong column type on geographic columns -


we have rails app uses postgis , activerecord-postgis-adapter geographic information search. however, doesn't work right in test database. in development , production database, geographic columns type "geography(point, 4236)". in test, same columns have type "geometry". means geographic searches don't spherical geographic distance ... plain cartesian geometry, means numbers typically off 100,000. boo.

here's looks in schema.rb:

create_table "buyers", :force => true |t|   # snip    t.spatial  "geocoded_coordinates",    :limit => {:srid=>4326, :type=>"point", :geographic=>true} end 

and in database.yml:

development: &development   adapter: postgis   database: lvs_dev   username: postgres   host:     "lrd-db"   template: template_postgis  test:   <<: *development   database: lvs_test 

the resulting columns in database (via psql):

lvs_dev:

lvs_dev=# \d+ buyers table "public.buyers" # snip geocoded_coordinates    | geography(point,4326)       |                                                      | main     | 

lvs_test:

lvs_dev=# \d+ buyers table "public.buyers" # snip geocoded_coordinates    | geometry                    |                                                      | main     | 

so ... gives here? ideas why rails / rake creating different db schema in development , test?

did try dropping , recreating test db, running migrations again? also, check see if it's reloading test db schema somewhere instead of running migrations.


Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -