X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/91374368faffee13ded82b9718078d5593e32fed..0be6dd860f1843681e6380fbe69ca71a6eb01ab7:/lib/migrate.rb diff --git a/lib/migrate.rb b/lib/migrate.rb index df7e5f7ae..38f8db6b3 100644 --- a/lib/migrate.rb +++ b/lib/migrate.rb @@ -49,6 +49,7 @@ module ActiveRecord types[:bigint_auto_64] = { :name => "bigint(64) DEFAULT NULL auto_increment" } types[:bigint_auto_11] = { :name => "bigint(11) DEFAULT NULL auto_increment" } types[:bigint_auto_20] = { :name => "bigint(20) DEFAULT NULL auto_increment" } + types[:four_byte_unsigned] = { :name=> "integer unsigned NOT NULL" } types end @@ -81,6 +82,14 @@ module ActiveRecord 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