class AddOwnerToCommonTasks < ActiveRecord::Migration
  def change
    add_reference :common_tasks, :owner, index: true, foreign_key: true
  end
end

class AddOwnerToCommonTasks < ActiveRecord::Migration
  def change
    add_reference :common_tasks, :owner, index: true, foreign_key: { to_table: :users }
  end
end

Fix foreign key problem in postgresql
Fix foreign key problem in postgresql

Since the CommonTask#owner reference is actually referencing the users table
then a :to_table option needs to be added to the foreign key attributed to
keep it from trying to use a non-existant owners table rather than the
appropriate users table.
