Files
Redmine/db/migrate/20250423065135_create_reactions.rb
Go MAEDA 403c10091f Introduce reactions feature (so-called "like button") to issues, notes, news, and forums (#42630).
Patch by Katsuya HIDAKA (user:hidakatsuya).


git-svn-id: https://svn.redmine.org/redmine/trunk@23755 e93f8b46-1217-0410-a6f0-8f06a7374b81
2025-05-11 07:59:16 +00:00

12 lines
397 B
Ruby

class CreateReactions < ActiveRecord::Migration[7.2]
def change
create_table :reactions do |t|
t.references :reactable, polymorphic: true, null: false
t.references :user, null: false
t.timestamps null: false
end
add_index :reactions, [:reactable_type, :reactable_id, :user_id], unique: true
add_index :reactions, [:reactable_type, :reactable_id, :id]
end
end