class AddAuthorToTasks < ActiveRecord::Migration[5.0]
  def change
    add_reference :tasks, :author, foreign_key: true
  end
end

class AddAuthorToTasks < ActiveRecord::Migration[5.0]
  def change
    add_reference :tasks, :author, foreign_key: { to_table: :users }
  end
end

Fix foreign key reference in migration
Fix foreign key reference in migration
