闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
598 B

  1. class CreateAnnouncementReactions < ActiveRecord::Migration[5.2]
  2. def change
  3. create_table :announcement_reactions do |t|
  4. t.belongs_to :account, foreign_key: { on_delete: :cascade, index: false }
  5. t.belongs_to :announcement, foreign_key: { on_delete: :cascade }
  6. t.string :name, null: false, default: ''
  7. t.belongs_to :custom_emoji, foreign_key: { on_delete: :cascade }
  8. t.timestamps
  9. end
  10. add_index :announcement_reactions, [:account_id, :announcement_id, :name], unique: true, name: :index_announcement_reactions_on_account_id_and_announcement_id
  11. end
  12. end