开发者

Index Multiple Columns w/ Ruby on Rails

开发者 https://www.devze.com 2023-01-17 23:07 出处:网络
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:

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]

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号