```ruby
class CreateChatRooms < ActiveRecord::Migration
  def change
    create_table :chat_rooms do |t|
      t.references :sender
      t.references :recipient

      t.timestamps null: false
    end
  end
end
```

Add constraints to chat rooms migration
user
```ruby
class CreateChatRooms < ActiveRecord::Migration
  def change
    create_table :chat_rooms do |t|
      t.references :sender, index: true, foreign_key: true
      t.references :recipient, index: true, foreign_key: true

      t.timestamps null: false
    end
  end
end
```
assistant