]> git.openstreetmap.org Git - rails.git/blobdiff - lib/migrate.rb
Fix update-wiki-pages to resolve redirects correctly
[rails.git] / lib / migrate.rb
index 75e047815a073004eb8f5c7fc8467f1840a9f944..7c14333b30af91f0ad23b6f690d65d5852d11abb 100644 (file)
@@ -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[: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})"
         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})"
@@ -134,10 +137,6 @@ module ActiveRecord
       def rename_index(table_name, old_name, new_name)
         execute "ALTER INDEX #{quote_table_name(old_name)} RENAME TO #{quote_table_name(new_name)}"
       end
       def rename_index(table_name, old_name, new_name)
         execute "ALTER INDEX #{quote_table_name(old_name)} RENAME TO #{quote_table_name(new_name)}"
       end
-
-      def rename_sequence(table_name, old_name, new_name)
-        execute "ALTER SEQUENCE #{quote_table_name(old_name)} RENAME TO #{quote_table_name(new_name)}"
-      end
     end
   end
 end
     end
   end
 end