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

Fix foreign key problem in postgresql
user
```ruby
class AddOwnerToCommonTasks < ActiveRecord::Migration
  def change
    add_reference :common_tasks, :owner, index: true, foreign_key: { to_table: :users }
  end
end
```
assistant