class AddIndexToUnits < ActiveRecord::Migration def self.up add_index :units,:lesson_id end def self.down remove :units end end
我有一种感觉self.down可能是错的,我不确定.
remove_index :units,:column => :lesson_id