By default, string and text data types allows null values, also it's their default value, unless you have previously defined some constraint
Anyway, being explicit, this should work:
def up
change_column :animals, :title, :text, null: true, default: nil
change_column :animals, :description, :text, null: true, default: nil
end
def down
change_column :animals, :title, :string
change_column :animals, :description, :string
end
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…