Index Multiple Columns w/ Ruby on Rails
I have a table in a Mysql db that I want to use multicolumn indexing on. How can I do t开发者_如何学运维his in rails w/o using the mysql console?
Inside a migration definition you can do it like this:
add_index :table_name, [:column1, :column2]
精彩评论