]> git.openstreetmap.org Git - rails.git/commitdiff
Fix rails 4 compatibility issues in migrations
authorTom Hughes <tom@compton.nu>
Tue, 6 Aug 2013 22:11:31 +0000 (23:11 +0100)
committerTom Hughes <tom@compton.nu>
Sat, 21 Sep 2013 11:03:53 +0000 (12:03 +0100)
db/migrate/001_create_osm_db.rb
db/migrate/031_create_countries.rb
db/migrate/053_add_map_bug_tables.rb
db/migrate/054_refactor_map_bug_tables.rb

index 8ddc68bcd1695f28cf01857b7ffdc9e98f3379a7..d952c0a07693b60cf1297ff987d4a60c9c996874 100644 (file)
@@ -78,11 +78,11 @@ class CreateOsmDb < ActiveRecord::Migration
 
     create_table "gps_points", myisam_table do |t|
       t.column "altitude",  :float
 
     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 "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
 
       t.column "timestamp", :datetime
     end
 
index cc0627cd291fdc1b064811748b854015aa755653..337e86fde5fd1ba736a28710aaeff1e1f2a39541 100644 (file)
@@ -24,11 +24,11 @@ class CreateCountries < ActiveRecord::Migration
         maxlon = ele.get_text("bBoxEast").to_s
         maxlat = ele.get_text("bBoxNorth").to_s
 
         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
           :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
       end
     end
   end
index b3a1acee64ccdadc373f996b9b8e0de6f1fee75e..6851a20b4d4f8c5e8efaa0235c81d961694510a4 100644 (file)
@@ -5,7 +5,6 @@ class AddMapBugTables < ActiveRecord::Migration
     create_enumeration :map_bug_status_enum, ["open", "closed", "hidden"]
 
     create_table :map_bugs do |t|
     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.integer :latitude, :null => false 
       t.integer :longitude, :null => false 
       t.column :tile, :bigint, :null => false
@@ -16,6 +15,8 @@ class AddMapBugTables < ActiveRecord::Migration
       t.column :status, :map_bug_status_enum, :null => false
     end
 
       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"
     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"
index b094cc593e7d93435f609b166ae6f7225285128e..d94105035551c3739af29832d28d5deee1e8af32 100644 (file)
@@ -3,7 +3,6 @@ require 'migrate'
 class RefactorMapBugTables < ActiveRecord::Migration
   def self.up
     create_table :map_bug_comment do |t|
 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
       t.column :bug_id, :bigint, :null => false
       t.boolean :visible, :null => false 
       t.datetime :date_created, :null => false
@@ -15,6 +14,8 @@ class RefactorMapBugTables < ActiveRecord::Migration
 
     remove_column :map_bugs, :text 
 
 
     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]
     add_index :map_bug_comment, [:bug_id], :name => "map_bug_comment_id_idx"
 
     add_foreign_key :map_bug_comment, [:bug_id], :map_bugs, [:id]