diff --git a/app/models/table.rb b/app/models/table.rb index abe23941e4..49fca95115 100644 --- a/app/models/table.rb +++ b/app/models/table.rb @@ -184,6 +184,7 @@ class Table < Sequel::Model(:user_tables) schema = [schema] + temporal_schema created_at = schema.delete([:created_at, "timestamp without time zone"]) updated_at = schema.delete([:updated_at, "timestamp without time zone"]) + schema.delete([:the_geom, "geometry"]) if lat_column && lon_column schema.each do |col| col << "latitude" if col[0].to_sym == lat_column diff --git a/spec/models/table_spec.rb b/spec/models/table_spec.rb index faa8921560..75ed069c61 100644 --- a/spec/models/table_spec.rb +++ b/spec/models/table_spec.rb @@ -437,7 +437,7 @@ describe Table do table.rows_counted.should == 5 table.schema.should == [[:cartodb_id, "integer"], [:id, "integer"], [:name, "character varying"], [:lat, "double precision"], - [:lon, "double precision"], [:the_geom, "geometry"], [:created_at, "timestamp"], [:updated_at, "timestamp"] + [:lon, "double precision"], [:created_at, "timestamp"], [:updated_at, "timestamp"] ] row = table.to_json[:rows][0] row[:cartodb_id].should == 1 @@ -448,7 +448,7 @@ describe Table do table.lat_column.should == :lat table.lon_column.should == :lon table.schema.should == [[:cartodb_id, "integer"], [:id, "integer"], [:name, "character varying"], [:lat, "double precision", "latitude"], - [:lon, "double precision", "longitude"], [:the_geom, "geometry"], [:created_at, "timestamp"], [:updated_at, "timestamp"] + [:lon, "double precision", "longitude"], [:created_at, "timestamp"], [:updated_at, "timestamp"] ] # Vizzuality HQ