X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/c19d1b406b149040a37ef22f4f14eeddc29cf0ea..b6c354b31b8e7963bbd384045cb72cd3a88c613e:/lib/migrate.rb diff --git a/lib/migrate.rb b/lib/migrate.rb index 77bc93646..69538f1da 100644 --- a/lib/migrate.rb +++ b/lib/migrate.rb @@ -73,6 +73,22 @@ module ActiveRecord def innodb_table return { :id => false, :force => true, :options => "ENGINE=InnoDB" } end + + def innodb_option + return "ENGINE=InnoDB" + end + + def change_engine (table_name, engine) + execute "ALTER TABLE #{table_name} ENGINE = #{engine}" + end + + def add_fulltext_index (table_name, column) + execute "CREATE FULLTEXT INDEX `#{table_name}_#{column}_idx` ON `#{table_name}` (`#{column}`)" + end + + def alter_column_nwr_enum (table_name, column) + execute "alter table #{table_name} change column #{column} #{column} enum('node','way','relation');" + end end end end