本文介绍了Rails Migration 使列为 null =>真的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我最初创建了一个列为的表
I had originally created a table with column as
t.string "email", :default => "", :null => false要求已更改,现在我需要允许电子邮件为空.如何编写迁移以使 :null => true
The requirement has changed and now I need to allow email to be null. How can I write a migration to make :null => true
推荐答案试试:
change_column :table_name, :email, :string, null: true更多推荐
Rails Migration 使列为 null =>真的
发布评论