From 57785a116d539ac0d6e6f306591d6030e84789c7 Mon Sep 17 00:00:00 2001 From: Karina Kwiatek Date: Fri, 8 Jul 2022 22:39:33 +0200 Subject: [PATCH] Add migration to correct notification target types --- .../20220708203722_correct_notification_target_types.rb | 9 +++++++++ db/schema.rb | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20220708203722_correct_notification_target_types.rb diff --git a/db/migrate/20220708203722_correct_notification_target_types.rb b/db/migrate/20220708203722_correct_notification_target_types.rb new file mode 100644 index 00000000..2782eba0 --- /dev/null +++ b/db/migrate/20220708203722_correct_notification_target_types.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class CorrectNotificationTargetTypes < ActiveRecord::Migration[6.1] + def up + execute "UPDATE notifications SET target_type = 'Appendable' WHERE target_type = 'Appendable::Reaction'" + + execute "UPDATE notifications SET target_type = 'Relationship' WHERE target_type = 'Relationships::Follow'" + end +end diff --git a/db/schema.rb b/db/schema.rb index a7e7ab97..f4a958cb 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2022_07_06_174816) do +ActiveRecord::Schema.define(version: 2022_07_08_203722) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql"