This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
2023-05-27 03:56:39 -07:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-11-24 03:50:32 -08:00
|
|
|
class CreateStatusReactions < ActiveRecord::Migration[6.1]
|
|
|
|
def change
|
|
|
|
create_table :status_reactions do |t|
|
2022-12-17 19:23:42 -08:00
|
|
|
t.references :account, null: false, foreign_key: { on_delete: :cascade }
|
|
|
|
t.references :status, null: false, foreign_key: { on_delete: :cascade }
|
2022-11-24 03:50:32 -08:00
|
|
|
t.string :name, null: false, default: ''
|
2022-12-17 19:23:42 -08:00
|
|
|
t.references :custom_emoji, null: true, foreign_key: { on_delete: :cascade }
|
2022-11-24 03:50:32 -08:00
|
|
|
|
|
|
|
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
|