In a Rails Migration (MySQL), can you specify what position a new column should be?

前端 未结 5 1323
旧时难觅i
旧时难觅i 2020-12-08 18:36

If I\'m adding a column via MySQL, I can specify where in the table that column will be using the AFTER modifier. But if I do the add_column via a Rails migration, the colum

5条回答
  •  无人及你
    2020-12-08 18:59

    I created a patch that adds this additional functionality to the ActiveRecord Mysql adapter. It works for master and 2-3-stable.

    https://rails.lighthouseapp.com/projects/8994/tickets/3286-patch-add-support-for-mysql-column-positioning-to-migrations

    It might be mysql specific, but it doesn't make your migrations any less portable (other adapters would just ignore the extra positioning options).

提交回复
热议问题