rails/rails — pull request #3529 by vjebelev (2011-11-05 14:42:02+00:00)
Title: AR changes to support creating ordered (asc, desc) indexes

Allows to have AR migrations that create indexes with specified per-column order (asc, desc) for some extra performance fine-tuning, e.g. http://stackoverflow.com/questions/743858/sql-server-indexes-ascending-or-descending-what-difference-does-it-make . Supported by most SQL databases.

add_index(:accounts, [:branch_id, :party_id], :order => {:branch_id => :desc, :part_id => :asc})

generates

CREATE INDEX by_branch_desc_party ON accounts(branch_id DESC, party_id ASC)

(this is to replace pull request 3351)