X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/99a2b549d47b4562e5e11ea1d9059f377182b94d..e825f8b2647fb1bc62fb017149930b94ec4d4ea2:/lib/migrate.rb diff --git a/lib/migrate.rb b/lib/migrate.rb index baa7faecd..7c14333b3 100644 --- a/lib/migrate.rb +++ b/lib/migrate.rb @@ -126,6 +126,9 @@ module ActiveRecord if Hash === options and options[:lowercase] quoted_column_names = quoted_column_names.map { |e| "LOWER(#{e})" } end + if Hash === options and options[:columns] + quoted_column_names = quoted_column_names + Array[options[:columns]] + end quoted_column_names = quoted_column_names.join(", ") execute "CREATE #{index_type} INDEX #{quote_column_name(index_name)} ON #{quote_table_name(table_name)} USING #{index_method} (#{quoted_column_names})"