]> git.openstreetmap.org Git - rails.git/blobdiff - db/migrate/021_move_to_innodb.rb
Cleanup trailing whitespace
[rails.git] / db / migrate / 021_move_to_innodb.rb
index da0488ca5f7a3d6bb40f6ccc7717ceb34487096e..aeb84028e00cd6615ec68fe6a290297fc944588c 100644 (file)
@@ -1,3 +1,5 @@
+require 'migrate'
+
 class MoveToInnodb < ActiveRecord::Migration
   @@conv_tables = ['nodes', 'ways', 'way_tags', 'way_nodes',
     'current_way_tags', 'relation_members',
@@ -10,17 +12,13 @@ class MoveToInnodb < ActiveRecord::Migration
     remove_index :current_relation_tags, :name=> :current_relation_tags_v_idx
 
     @@ver_tbl.each { |tbl|
-      change_column tbl, "version", :bigint, :limit => 20, :null => false
-    }
-
-    @@conv_tables.each { |tbl|
-      change_engine (tbl, "InnoDB")
+      change_column tbl, "version", :bigint, :null => false
     }
 
     @@ver_tbl.each { |tbl|
-      add_column "current_#{tbl}", "version", :bigint, :limit => 20, :null => false
-      # As the initial version of all nodes, ways and relations is 0, we set the 
-      # current version to something less so that we can update the version in 
+      add_column "current_#{tbl}", "version", :bigint, :null => false
+      # As the initial version of all nodes, ways and relations is 0, we set the
+      # current version to something less so that we can update the version in
       # batches of 10000
       tbl.classify.constantize.update_all("version=-1")
       while tbl.classify.constantize.count(:conditions => {:version => -1}) > 0
@@ -40,6 +38,6 @@ class MoveToInnodb < ActiveRecord::Migration
   end
 
   def self.down
-    raise IrreversibleMigration.new
+    raise ActiveRecord::IrreversibleMigration
   end
 end