3 class TileTracepoints < ActiveRecord::Migration
5 add_column "gps_points", "tile", :four_byte_unsigned
6 add_index "gps_points", ["tile"], :name => "points_tile_idx"
7 remove_index "gps_points", :name => "points_idx"
10 Tracepoint.update_all("latitude = latitude * 10, longitude = longitude * 10, tile = tile_for_point(latitude * 10, longitude * 10)")
11 rescue ActiveRecord::StatementInvalid => ex
12 Tracepoint.find(:all).each do |tp|
13 tp.latitude = tp.latitude * 10
14 tp.longitude = tp.longitude * 10
21 Tracepoint.update_all("latitude = latitude / 10, longitude = longitude / 10")
23 add_index "gps_points", ["latitude", "longitude"], :name => "points_idx"
24 remove_index "gps_points", :name => "points_tile_idx"
25 remove_column "gps_points", "tile"