Merge branch 'fix_set_null_false_migration' into 'master'

Adding NULL:false constraint with change_column_null instead of change_column

Closes #32450

See merge request !11471
This commit is contained in:
Yorick Peterse 2017-05-18 11:10:42 +00:00
commit 9e34c8dc1c

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