Skip to content

Commit

Permalink
Merge pull request #1424 from Retrospring/fix/move-appendable-notific…
Browse files Browse the repository at this point in the history
…ations

Add migration for moving notifications for appendables to reactions
  • Loading branch information
raccube authored Oct 28, 2023
2 parents a9f988d + a9ed8a6 commit 63b22a1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions db/migrate/20231028091613_move_appendable_notifications.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

class MoveAppendableNotifications < ActiveRecord::Migration[7.0]
def up
Notification::where(target_type: "Appendable").update_all(target_type: "Reaction") # rubocop:disable Rails/SkipsModelValidations
end

def down
Notification::where(target_type: "Reaction").update_all(type: "Appendable") # rubocop:disable Rails/SkipsModelValidations
end
end

0 comments on commit 63b22a1

Please sign in to comment.