From 23a7f00524b696847f8c127679c0413ac8f736f9 Mon Sep 17 00:00:00 2001 From: Blake Erickson Date: Wed, 20 Nov 2024 12:59:07 -0700 Subject: [PATCH] DEV: Re-apply chat index migration (#29859) Commit c2a733a95a422837d517a991de04f8462119cc5e was applied to an existing migration that possibly had already run. Due to this some discourse instances might not have the correct index. This change removes the original migration and creates a new one so that it will actually be applied. This is the missing index that some sites might not have: ``` Missing Index | CREATE INDEX index_chat_messages_on_chat_channel_id_and_id ON public.chat_messages USING btree (chat_channel_id, id) WHERE (deleted_at IS NOT NULL) ``` --- ...41120182858_add_index_to_chat_messages_on_chat_channel_id.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename plugins/chat/db/migrate/20221219082223_add_index_to_chat_messages.rb => db/migrate/20241120182858_add_index_to_chat_messages_on_chat_channel_id.rb (87%) diff --git a/plugins/chat/db/migrate/20221219082223_add_index_to_chat_messages.rb b/db/migrate/20241120182858_add_index_to_chat_messages_on_chat_channel_id.rb similarity index 87% rename from plugins/chat/db/migrate/20221219082223_add_index_to_chat_messages.rb rename to db/migrate/20241120182858_add_index_to_chat_messages_on_chat_channel_id.rb index f63d6dfae5b..18df1869912 100644 --- a/plugins/chat/db/migrate/20221219082223_add_index_to_chat_messages.rb +++ b/db/migrate/20241120182858_add_index_to_chat_messages_on_chat_channel_id.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class AddIndexToChatMessages < ActiveRecord::Migration[7.0] +class AddIndexToChatMessagesOnChatChannelId < ActiveRecord::Migration[7.1] disable_ddl_transaction! def up