I already migrated a table called units with several columns. I was wondering how to migrate in a stand alone \'add_index\' to this table using the cmd. Is this code correct:
To remove an index, you must use remove_index with the same table and column specification as the self.up's add_index has. So:
remove_index
add_index
def self.down remove_index :units, :lesson_id end
A multi-column index example would be:
def self.down remove_index :units, [:lesson_id, :user_id] end