Migration to create default value
问题 So I want to know whether we can write a new migration just to set default value of a field,which is already created. I know how to write edit the old migration and set its default value. I want to do this because I have done so many migrations and I cant roll back now and edit that file. And also, Is there any way to rollback to a particular migration? Thanks in advance 回答1: Run rails g migration add_default_value_to_table then in the migration file def up change_column :table_name, :column