X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/52e5fa6ad78f375cec5a207a123a4aa3939c8ddf..34e3e51456774127d43408b7ab65c24f41373f62:/db/migrate/021_move_to_innodb.rb diff --git a/db/migrate/021_move_to_innodb.rb b/db/migrate/021_move_to_innodb.rb index 50e7ec8be..aeb84028e 100644 --- a/db/migrate/021_move_to_innodb.rb +++ b/db/migrate/021_move_to_innodb.rb @@ -1,4 +1,4 @@ -require 'lib/migrate' +require 'migrate' class MoveToInnodb < ActiveRecord::Migration @@conv_tables = ['nodes', 'ways', 'way_tags', 'way_nodes', @@ -12,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