1
0

20200113125135_create_announcement_mutes.rb 420 B

1234567891011121314
  1. # frozen_string_literal: true
  2. class CreateAnnouncementMutes < ActiveRecord::Migration[5.2]
  3. def change
  4. create_table :announcement_mutes do |t|
  5. t.belongs_to :account, foreign_key: { on_delete: :cascade, index: false }
  6. t.belongs_to :announcement, foreign_key: { on_delete: :cascade }
  7. t.timestamps
  8. end
  9. add_index :announcement_mutes, [:account_id, :announcement_id], unique: true
  10. end
  11. end