mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 09:08:10 +08:00
DEV: Make sure chat migration is in plugin directory (#29867)
This migration is for chat so it needs to live in the chat plugin directory. Follow up to: 23a7f00524b696847f8c127679c0413ac8f736f9
This commit is contained in:
@ -0,0 +1,22 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddIndexToChatMessagesOnChatChannelId < ActiveRecord::Migration[7.1]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
# Transaction has been disabled so we need to clean up the invalid index if index creation timeout
|
||||
execute <<~SQL
|
||||
DROP INDEX CONCURRENTLY IF EXISTS index_chat_messages_on_chat_channel_id_and_id
|
||||
SQL
|
||||
|
||||
execute <<~SQL
|
||||
CREATE INDEX CONCURRENTLY index_chat_messages_on_chat_channel_id_and_id
|
||||
ON chat_messages (chat_channel_id,id)
|
||||
WHERE deleted_at IS NOT NULL
|
||||
SQL
|
||||
end
|
||||
|
||||
def down
|
||||
raise ActiveRecord::IrreversibleMigration
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user