Adding NULL:false constraint with change_column_null instead of change_column
This commit is contained in:
parent
a49337727b
commit
2950564ae6
1 changed files with 4 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue