From a9ed8a608953a938926740abdbace7e22ca2c656 Mon Sep 17 00:00:00 2001 From: Karina Kwiatek Date: Sat, 28 Oct 2023 11:20:17 +0200 Subject: [PATCH] Add migration for moving notifications for appendables to reactions --- .../20231028091613_move_appendable_notifications.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 db/migrate/20231028091613_move_appendable_notifications.rb diff --git a/db/migrate/20231028091613_move_appendable_notifications.rb b/db/migrate/20231028091613_move_appendable_notifications.rb new file mode 100644 index 00000000..0763ed42 --- /dev/null +++ b/db/migrate/20231028091613_move_appendable_notifications.rb @@ -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