Permalink
Browse files

In dumper, dont add srid to column unless it has a value

  • Loading branch information...
1 parent 262bbf1 commit 2ca2d89dc619b3a3961bb98853f3043682bbc87a @kbrock kbrock committed Dec 19, 2012
Showing with 23 additions and 23 deletions.
  1. +1 −1 lib/postgres_gis/active_record/schema_dumper.rb
  2. +22 −22 spec/dummy/db/schema.rb
@@ -12,7 +12,7 @@ class SchemaDumper
def column_spec_with_gis(column)
spec = column_spec_without_gis(column)
spec[:type] = column.geometry_type.to_s if column.geometry_type
- spec[:srid] = column.srid.inspect if column.srid && column.srid != -1
+ spec[:srid] = column.srid.inspect if column.srid && column.srid != -1 && column.srid != 0
spec[:with_z] = 'true' if column.with_z
spec[:with_m] = 'true' if column.with_m
spec[:geographic] = 'true' if column.geographic?
View
@@ -17,53 +17,53 @@
add_extension "postgis"
add_extension "postgis_topology"
create_table "geography_point4_models", :force => true do |t|
- t.string "extra", :srid => 0
+ t.string "extra"
t.point "geom", :srid => 4326, :with_z => true, :with_m => true, :geographic => true
end
create_table "geography_point_models", :force => true do |t|
- t.string "extra", :srid => 0
+ t.string "extra"
t.point "geom", :srid => 4326, :geographic => true
end
add_index "geography_point_models", ["extra"], :name => "index_geography_point_models_on_extra"
add_index "geography_point_models", ["geom"], :name => "index_geography_point_models_on_geom", :index_type => :gist
create_table "geography_pointm_models", :force => true do |t|
- t.string "extra", :srid => 0
+ t.string "extra"
t.point "geom", :srid => 4326, :with_m => true, :geographic => true
end
create_table "geography_pointz_models", :force => true do |t|
- t.string "extra", :srid => 0
+ t.string "extra"
t.point "geom", :srid => 4326, :with_z => true, :geographic => true
end
create_table "geography_polygon_models", :force => true do |t|
- t.string "extra", :srid => 0
+ t.string "extra"
t.polygon "geom", :srid => 4326, :geographic => true
end
create_table "geometry_models", :force => true do |t|
- t.string "extra", :srid => 0
+ t.string "extra"
t.geometry "geom", :srid => 4326
end
create_table "layer", :id => false, :force => true do |t|
- t.integer "topology_id", :null => false, :srid => 0
- t.integer "layer_id", :null => false, :srid => 0
- t.string "schema_name", :limit => nil, :null => false, :srid => 0
- t.string "table_name", :limit => nil, :null => false, :srid => 0
- t.string "feature_column", :limit => nil, :null => false, :srid => 0
- t.integer "feature_type", :null => false, :srid => 0
- t.integer "level", :default => 0, :null => false, :srid => 0
- t.integer "child_id", :srid => 0
+ t.integer "topology_id", :null => false
+ t.integer "layer_id", :null => false
+ t.string "schema_name", :limit => nil, :null => false
+ t.string "table_name", :limit => nil, :null => false
+ t.string "feature_column", :limit => nil, :null => false
+ t.integer "feature_type", :null => false
+ t.integer "level", :default => 0, :null => false
+ t.integer "child_id"
end
add_index "layer", ["schema_name", "table_name", "feature_column"], :name => "layer_schema_name_table_name_feature_column_key", :unique => true
create_table "point4_models", :force => true do |t|
- t.string "extra", :srid => 0
+ t.string "extra"
t.point "geom", :srid => 4326, :with_z => true, :with_m => true
end
@@ -78,25 +78,25 @@
add_index "point_models", ["geom"], :name => "index_point_models_on_geom", :index_type => :gist
create_table "pointm_models", :force => true do |t|
- t.string "extra", :srid => 0
+ t.string "extra"
t.point "geom", :srid => 4326, :with_m => true
end
create_table "pointz_models", :force => true do |t|
- t.string "extra", :srid => 0
+ t.string "extra"
t.point "geom", :srid => 4326, :with_z => true
end
create_table "polygon_models", :force => true do |t|
- t.string "extra", :srid => 0
+ t.string "extra"
t.polygon "geom", :srid => 4326
end
create_table "topology", :force => true do |t|
- t.string "name", :limit => nil, :null => false, :srid => 0
- t.integer "srid", :null => false, :srid => 0
- t.float "precision", :null => false, :srid => 0
- t.boolean "hasz", :default => false, :null => false, :srid => 0
+ t.string "name", :limit => nil, :null => false
+ t.integer "srid", :null => false
+ t.float "precision", :null => false
+ t.boolean "hasz", :default => false, :null => false
end
add_index "topology", ["name"], :name => "topology_name_key", :unique => true

0 comments on commit 2ca2d89

Please sign in to comment.