26778823b9
Squashed, modified, and rebased from glitch-soc/mastodon#2221. Co-authored-by: fef <owo@fef.moe> Co-authored-by: Jeremy Kescher <jeremy@kescher.at> Co-authored-by: neatchee <neatchee@gmail.com> Co-authored-by: Ivan Rodriguez <104603218+IRod22@users.noreply.github.com> Co-authored-by: Plastikmensch <plastikmensch@users.noreply.github.com>
17 lines
610 B
Ruby
17 lines
610 B
Ruby
# frozen_string_literal: true
|
|
|
|
class CreateStatusReactions < ActiveRecord::Migration[6.1]
|
|
def change
|
|
create_table :status_reactions do |t|
|
|
t.references :account, null: false, foreign_key: { on_delete: :cascade }
|
|
t.references :status, null: false, foreign_key: { on_delete: :cascade }
|
|
t.string :name, null: false, default: ''
|
|
t.references :custom_emoji, null: true, foreign_key: { on_delete: :cascade }
|
|
|
|
t.timestamps
|
|
end
|
|
|
|
add_index :status_reactions, [:account_id, :status_id, :name], unique: true, name: :index_status_reactions_on_account_id_and_status_id
|
|
end
|
|
end
|