X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/550ce43250208b25d459247d3bbb5bbc25fa3ff4..0be6dd860f1843681e6380fbe69ca71a6eb01ab7:/lib/migrate.rb diff --git a/lib/migrate.rb b/lib/migrate.rb index 585b47b1c..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 @@ -85,6 +86,10 @@ module ActiveRecord 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