LoginSignup
2
1

More than 5 years have passed since last update.

RailsでOrder狙いの複合インデックスを貼る

Last updated at Posted at 2017-05-19

表題の通り。

ググっても日本語の情報は出てこなかったので、メモとして残しておく。

ちなみに普通にドキュメントに載ってた。

add_index(:accounts, [:branch_id, :party_id, :surname], order: {branch_id: :desc, party_id: :asc})

参考URL

あとがき

MySQLで使いたかったのに、MySQLで使えないらしい。

Note: MySQL doesn’t yet support index order (it accepts the syntax but ignores it).

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1