From 0f2067b36344390bed13aecb778388ed682fa506 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Thu, 25 Apr 2024 16:35:23 +0200 Subject: [PATCH] DEV: drop ignored columns (#26755) chat_channels - last_message_sent_at --- plugins/chat/app/models/chat/channel.rb | 1 - ...33407_drop_chat_channels_last_message_sent_at.rb | 13 +++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 plugins/chat/db/post_migrate/20240425133407_drop_chat_channels_last_message_sent_at.rb diff --git a/plugins/chat/app/models/chat/channel.rb b/plugins/chat/app/models/chat/channel.rb index 652b12edf7b..d7d70697f69 100644 --- a/plugins/chat/app/models/chat/channel.rb +++ b/plugins/chat/app/models/chat/channel.rb @@ -296,7 +296,6 @@ end # description :text # status :integer default("open"), not null # user_count :integer default(0), not null -# last_message_sent_at :datetime not null # auto_join_users :boolean default(FALSE), not null # user_count_stale :boolean default(FALSE), not null # slug :string diff --git a/plugins/chat/db/post_migrate/20240425133407_drop_chat_channels_last_message_sent_at.rb b/plugins/chat/db/post_migrate/20240425133407_drop_chat_channels_last_message_sent_at.rb new file mode 100644 index 00000000000..0a3b61d6c98 --- /dev/null +++ b/plugins/chat/db/post_migrate/20240425133407_drop_chat_channels_last_message_sent_at.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class DropChatChannelsLastMessageSentAt < ActiveRecord::Migration[7.0] + DROPPED_COLUMNS ||= { chat_channels: %i[last_message_sent_at] } + + def up + DROPPED_COLUMNS.each { |table, columns| Migration::ColumnDropper.execute_drop(table, columns) } + end + + def down + raise ActiveRecord::IrreversibleMigration + end +end