From ee4a0d448622e9cf552e3cc6477723ff3157cc6a Mon Sep 17 00:00:00 2001 From: Pranav Date: Fri, 27 Jun 2025 16:58:50 -0700 Subject: [PATCH] fix: disable_ddl_transaction! on add_index action (#11833) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All migrations will automatically be wrapped in a transaction. There are queries that you can’t execute inside a transaction. Adding index concurrently is one of them, we have to disable the transaction. I missed this in the earlier PR. #11831 --- db/migrate/20250627195529_add_index_to_messages.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/db/migrate/20250627195529_add_index_to_messages.rb b/db/migrate/20250627195529_add_index_to_messages.rb index ff58c31d4..eb6b95cdd 100644 --- a/db/migrate/20250627195529_add_index_to_messages.rb +++ b/db/migrate/20250627195529_add_index_to_messages.rb @@ -1,4 +1,6 @@ class AddIndexToMessages < ActiveRecord::Migration[7.0] + disable_ddl_transaction! + def change # This index is added as a temporary fix for performance issues in the CSAT # responses controller where we query messages with account_id, content_type