Merge pull request #1424 from Retrospring/fix/move-appendable-notifications

Add migration for moving notifications for appendables to reactions
This commit is contained in:
Karina Kwiatek 2023-10-28 11:23:05 +02:00 committed by GitHub
commit 63b22a14ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 0 deletions

View File

@ -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