X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/497009ed2b98dfdeeb349e891c1fbd88d14ff087..4d6df34c4bca932b75f2260fe533b4d22c3651f9:/db/migrate/002_cleanup_osm_db.rb diff --git a/db/migrate/002_cleanup_osm_db.rb b/db/migrate/002_cleanup_osm_db.rb index fb27c91b7..23f988dc1 100644 --- a/db/migrate/002_cleanup_osm_db.rb +++ b/db/migrate/002_cleanup_osm_db.rb @@ -1,6 +1,4 @@ -require 'migrate' - -class CleanupOsmDb < ActiveRecord::Migration +class CleanupOsmDb < ActiveRecord::Migration[4.2] def self.up change_column "current_nodes", "latitude", :float, :limit => 53, :null => false change_column "current_nodes", "longitude", :float, :limit => 53, :null => false @@ -21,7 +19,7 @@ class CleanupOsmDb < ActiveRecord::Migration change_column "current_way_segments", "id", :bigint, :null => false change_column "current_way_segments", "segment_id", :bigint, :null => false change_column "current_way_segments", "sequence_id", :bigint, :null => false - add_primary_key "current_way_segments", ["id", "sequence_id"] + add_primary_key "current_way_segments", %w[id sequence_id] remove_index "current_way_segments", :name => "current_way_segments_id_idx" change_column "current_way_tags", "id", :bigint, :null => false @@ -40,7 +38,7 @@ class CleanupOsmDb < ActiveRecord::Migration remove_index "gps_points", :name => "points_uid_idx" remove_index "gps_points", :name => "points_idx" remove_column "gps_points", "user_id" - add_index "gps_points", ["latitude", "longitude"], :name => "points_idx" + add_index "gps_points", %w[latitude longitude], :name => "points_idx" change_column "gps_points", "trackid", :integer, :null => false change_column "gps_points", "latitude", :integer, :null => false change_column "gps_points", "longitude", :integer, :null => false @@ -96,7 +94,7 @@ class CleanupOsmDb < ActiveRecord::Migration add_index "users", ["display_name"], :name => "users_display_name_idx", :unique => true change_column "way_segments", "segment_id", :bigint, :null => false - + change_column "way_tags", "k", :string, :null => false change_column "way_tags", "v", :string, :null => false change_column "way_tags", "version", :bigint, :null => false @@ -120,7 +118,7 @@ class CleanupOsmDb < ActiveRecord::Migration change_column "way_tags", "k", :string, :default => nil change_column "way_segments", "segment_id", :integer - + remove_index "users", :name => "users_display_name_idx" add_index "users", ["display_name"], :name => "users_display_name_idx" remove_index "users", :name => "users_email_idx" @@ -204,14 +202,14 @@ class CleanupOsmDb < ActiveRecord::Migration change_column "current_way_segments", "segment_id", :bigint change_column "current_way_segments", "id", :bigint - add_index "current_segments", ["id", "visible"], :name => "current_segments_id_visible_idx" + add_index "current_segments", %w[id visible], :name => "current_segments_id_visible_idx" remove_primary_key "current_segments" change_column "current_segments", "timestamp", :datetime change_column "current_segments", "visible", :boolean change_column "current_segments", "user_id", :bigint change_column "current_segments", "node_b", :bigint change_column "current_segments", "node_a", :bigint - + add_index "current_nodes", ["id"], :name => "current_nodes_id_idx" remove_primary_key "current_nodes" change_column "current_nodes", "timestamp", :datetime