Rescale GPS points correctly when downgrading from v5 to v4.
authorTom Hughes <tom@compton.nu>
Fri, 28 Sep 2007 23:33:32 +0000 (23:33 +0000)
committerTom Hughes <tom@compton.nu>
Fri, 28 Sep 2007 23:33:32 +0000 (23:33 +0000)
db/migrate/005_tile_tracepoints.rb

index f4d27c1..51a4d13 100644 (file)
@@ -16,6 +16,8 @@ class TileTracepoints < ActiveRecord::Migration
   end
 
   def self.down
+    Tracepoint.update_all("latitude = latitude / 10, longitude = longitude / 10")
+
     add_index "gps_points", ["latitude", "longitude"], :name => "points_idx"
     remove_index "gps_points", :name => "points_tile_idx"
     remove_column "gps_points", "tile"