Question

I have a table in a Mysql db that I want to use multicolumn indexing on. How can I do this in rails w/o using the mysql console?

Was it helpful?

Solution

Inside a migration definition you can do it like this:

add_index :table_name, [:column1, :column2]

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top