Rails: Is it bad to have an irreversible migration?

前端 未结 7 662
隐瞒了意图╮
隐瞒了意图╮ 2020-12-24 10:57

When is it acceptable to raise an ActiveRecord::IrreversibleMigration exception in the self.down method of a migration? When should you take the effort to actually implemen

7条回答
  •  庸人自扰
    2020-12-24 11:46

    Feeling like you need an irreversible migration is probably a sign you've got bigger problems looming. Maybe some specifics would help?

    As for your second question: I always take the 'effort' to write the reverse of migrations. Of course, I don't actually write the .down, TextMate inserts it automatically when creating the .up.

提交回复
热议问题