20171222171109_create_conversation_participations.rb 434 B

1234567891011121314
  1. class CreateConversationParticipations < ActiveRecord::Migration[5.1]
  2. def change
  3. create_table :conversation_participations do |t|
  4. t.integer :user_id
  5. t.integer :conversation_id
  6. t.datetime :viewed_at, null: false
  7. t.timestamps
  8. end
  9. add_index :conversation_participations,
  10. [:user_id, :conversation_id], unique: true,
  11. name: :index_participation_user_conversation
  12. end
  13. end