diff --git a/db/migrate/20250507211848_add_index_to_heartbeats.rb b/db/migrate/20250507211848_add_index_to_heartbeats.rb index 48410d1..8016b79 100644 --- a/db/migrate/20250507211848_add_index_to_heartbeats.rb +++ b/db/migrate/20250507211848_add_index_to_heartbeats.rb @@ -2,6 +2,7 @@ class AddIndexToHeartbeats < ActiveRecord::Migration[8.0] def change add_index :heartbeats, [ :user_id, :time ], name: "idx_heartbeats_user_time_active", - where: "deleted_at IS NULL" + where: "deleted_at IS NULL", + if_not_exists: true end end