From 839ea34c290ab04f597d9c10868eae38b21f2e29 Mon Sep 17 00:00:00 2001 From: Marcello Costagliola Date: Tue, 6 Oct 2026 21:55:54 +0200 Subject: [PATCH] Create the room and update time index only where it is missing The Rust port creates index_messages_on_room_id_and_updated_at on boot, under the same name, with CREATE INDEX IF NOT EXISTS (basecamp/once-campfire-rust#45). On a database the port has opened, this migration stopped db:prepare with "index ... already exists" and the app didn't start. With if_not_exists it skips an index that is already there and creates it everywhere else, and the dumped schema stays the same. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01LwoX7uRy5vFZSNKJhSqMSG --- ...261005022000_add_room_id_and_updated_at_index_to_messages.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/migrate/20261005022000_add_room_id_and_updated_at_index_to_messages.rb b/db/migrate/20261005022000_add_room_id_and_updated_at_index_to_messages.rb index e59196b..dd53cc5 100644 --- a/db/migrate/20261005022000_add_room_id_and_updated_at_index_to_messages.rb +++ b/db/migrate/20261005022000_add_room_id_and_updated_at_index_to_messages.rb @@ -1,5 +1,5 @@ class AddRoomIdAndUpdatedAtIndexToMessages < ActiveRecord::Migration[8.2] def change - add_index :messages, %i[ room_id updated_at ] + add_index :messages, %i[ room_id updated_at ], if_not_exists: true end end