From 8b147b7f845ba0eb3af2885fe1e27d95b12ced52 Mon Sep 17 00:00:00 2001 From: Andrei Prigorshnev Date: Thu, 11 Apr 2024 17:15:57 +0400 Subject: [PATCH] DEV: Drop chat_mention.notification_id column (#24800) We ignore this column since fbd24fa --- plugins/chat/app/models/chat/mention.rb | 1 - ...40000_drop_notification_id_from_chat_mentions.rb | 13 +++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 plugins/chat/db/post_migrate/20240408140000_drop_notification_id_from_chat_mentions.rb diff --git a/plugins/chat/app/models/chat/mention.rb b/plugins/chat/app/models/chat/mention.rb index 51fc6450724..7d56191d782 100644 --- a/plugins/chat/app/models/chat/mention.rb +++ b/plugins/chat/app/models/chat/mention.rb @@ -20,7 +20,6 @@ end # id :bigint not null, primary key # chat_message_id :integer not null # user_id :integer -# notification_id :integer not null # target_id :integer # type :integer not null # created_at :datetime not null diff --git a/plugins/chat/db/post_migrate/20240408140000_drop_notification_id_from_chat_mentions.rb b/plugins/chat/db/post_migrate/20240408140000_drop_notification_id_from_chat_mentions.rb new file mode 100644 index 00000000000..68fa46820c3 --- /dev/null +++ b/plugins/chat/db/post_migrate/20240408140000_drop_notification_id_from_chat_mentions.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class DropNotificationIdFromChatMentions < ActiveRecord::Migration[7.0] + DROPPED_COLUMNS ||= { chat_mentions: %i[notification_id] } + + def up + DROPPED_COLUMNS.each { |table, columns| Migration::ColumnDropper.execute_drop(table, columns) } + end + + def down + raise ActiveRecord::IrreversibleMigration + end +end