From 2a8e6fef94cad8ae2547b239b883bf0a963945d3 Mon Sep 17 00:00:00 2001 From: Anton Date: Thu, 19 Oct 2023 08:51:59 +0200 Subject: [PATCH] Fix notifications migration --- db/migrate/20231011103114_migrate_notification_to_noticed.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/db/migrate/20231011103114_migrate_notification_to_noticed.rb b/db/migrate/20231011103114_migrate_notification_to_noticed.rb index 7a52008ef..52ae684a4 100644 --- a/db/migrate/20231011103114_migrate_notification_to_noticed.rb +++ b/db/migrate/20231011103114_migrate_notification_to_noticed.rb @@ -6,7 +6,7 @@ class MigrateNotificationToNoticed < ActiveRecord::Migration[7.0] end def up - add_column :notifications, :params, :jsonb, default: {}, null: false + add_column :notifications, :params, :jsonb add_column :notifications, :type, :string add_column :notifications, :read_at, :datetime add_reference :notifications, :recipient, polymorphic: true @@ -49,6 +49,8 @@ class MigrateNotificationToNoticed < ActiveRecord::Migration[7.0] drop_table :user_notifications change_column_null :notifications, :type, false + change_column_null :notifications, :params, false + change_column_default :notifications, :params, {} remove_column :notifications, :type_of remove_column :notifications, :title