create_table "gps_points", myisam_table do |t|
t.column "altitude", :float
- t.column "user_id", :integer, :limit => 20
+ t.column "user_id", :integer
t.column "trackid", :integer
t.column "latitude", :integer
t.column "longitude", :integer
- t.column "gpx_id", :integer, :limit => 20
+ t.column "gpx_id", :integer
t.column "timestamp", :datetime
end
maxlon = ele.get_text("bBoxEast").to_s
maxlat = ele.get_text("bBoxNorth").to_s
- Country.create({
+ Country.create(
:code => code,
:min_lat => minlat.to_f, :max_lat => maxlat.to_f,
:min_lon => minlon.to_f, :max_lon => maxlon.to_f
- }, :without_protection => true)
+ )
end
end
end
create_enumeration :map_bug_status_enum, ["open", "closed", "hidden"]
create_table :map_bugs do |t|
- t.column :id, :bigint, :null => false
t.integer :latitude, :null => false
t.integer :longitude, :null => false
t.column :tile, :bigint, :null => false
t.column :status, :map_bug_status_enum, :null => false
end
+ change_column :map_bugs, :id, :bigint
+
add_index :map_bugs, [:tile, :status], :name => "map_bugs_tile_idx"
add_index :map_bugs, [:last_changed], :name => "map_bugs_changed_idx"
add_index :map_bugs, [:date_created], :name => "map_bugs_created_idx"
class RefactorMapBugTables < ActiveRecord::Migration
def self.up
create_table :map_bug_comment do |t|
- t.column :id, :bigint, :null => false
t.column :bug_id, :bigint, :null => false
t.boolean :visible, :null => false
t.datetime :date_created, :null => false
remove_column :map_bugs, :text
+ change_column :map_bug_comment, :id, :bigint
+
add_index :map_bug_comment, [:bug_id], :name => "map_bug_comment_id_idx"
add_foreign_key :map_bug_comment, [:bug_id], :map_bugs, [:id]