Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AR changes to support creating ordered (asc, desc) indexes #3529

Merged
merged 1 commit into from Nov 5, 2011
Merged

AR changes to support creating ordered (asc, desc) indexes #3529

merged 1 commit into from Nov 5, 2011

Conversation

vjebelev
Copy link
Contributor

@vjebelev vjebelev commented Nov 5, 2011

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)

jonleighton added a commit that referenced this pull request Nov 5, 2011
AR changes to support creating ordered (asc, desc) indexes
@jonleighton jonleighton merged commit 2751e21 into rails:master Nov 5, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants