fix: add if_not_exists to conversations.created_at index migration (#15214)

## Description

Follow-up to #15147. The migration missed `if_not_exists`, so it fails
with `index already exists` on a re-run or when the index is pre-built.
Makes it idempotent, matching recent concurrent-index migrations.

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)
This commit is contained in:
Vishnu Narayanan
2026-07-28 16:21:25 +05:30
committed by GitHub
parent 3a8c5117da
commit 1e33bfd553

View File

@@ -2,6 +2,6 @@ class AddIndexToConversationsCreatedAt < ActiveRecord::Migration[7.1]
disable_ddl_transaction!
def change
add_index :conversations, :created_at, algorithm: :concurrently
add_index :conversations, :created_at, algorithm: :concurrently, if_not_exists: true
end
end