Adding NULL:false constraint with change_column_null instead of change_column

This commit is contained in:
Valery Sizov 2017-05-18 11:21:01 +03:00
parent a49337727b
commit 2950564ae6

View file

@ -26,12 +26,12 @@ class AddConstraintsToIssueAssigneesTable < ActiveRecord::Migration
# disable_ddl_transaction!
def up
change_column :issue_assignees, :issue_id, :integer, null: false
change_column :issue_assignees, :user_id, :integer, null: false
change_column_null :issue_assignees, :issue_id, false
change_column_null :issue_assignees, :user_id, false
end
def down
change_column :issue_assignees, :issue_id, :integer
change_column :issue_assignees, :user_id, :integer
change_column_null :issue_assignees, :issue_id, true
change_column_null :issue_assignees, :user_id, true
end
end