Only run if not exists

This commit is contained in:
Max Wofford 2025-05-07 17:21:34 -04:00
parent 62a7a8a7a3
commit eccd1acc9b

View file

@ -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