1 class TileTracepoints < ActiveRecord::Migration
3 add_column "gps_points", "tile", :integer, :null => false, :unsigned => true
4 add_index "gps_points", ["tile"], :name => "points_tile_idx"
5 remove_index "gps_points", :name => "points_idx"
8 Tracepoint.update_all("latitude = latitude * 10, longitude = longitude * 10, tile = tile_for_point(latitude * 10, longitude * 10)")
9 rescue ActiveRecord::StatementInvalid => ex
10 Tracepoint.find(:all).each do |tp|
11 tp.latitude = tp.latitude * 10
12 tp.longitude = tp.longitude * 10
19 add_index "gps_points", ["latitude", "longitude"], :name => "points_idx"
20 remove_index "gps_points", :name => "points_tile_idx"
21 remove_column "gps_points", "tile"