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:
class AddIndexToUnits < ActiveRecord::Migration
def self.up
add_index :units, :lesson_id, :name=>'lesson_index'
end
def self.down
remove_index :units, 'lesson_index'
end
end