Add if_not_exists to recent indexes

This commit is contained in:
Max Wofford
2025-06-17 14:29:57 -04:00
parent 9676fd13f1
commit df0f187b6e
2 changed files with 4 additions and 2 deletions

View File

@@ -5,6 +5,7 @@ class AddIndexToGoodJobsFinishedAtWithError < ActiveRecord::Migration[8.0]
add_index :good_jobs, :finished_at,
where: 'error IS NOT NULL',
algorithm: :concurrently,
name: 'index_good_jobs_finished_at_with_error'
name: 'index_good_jobs_finished_at_with_error',
if_not_exists: true
end
end

View File

@@ -5,6 +5,7 @@ class AddIndexToAhoyVisitsStartedAtWithReferringDomain < ActiveRecord::Migration
add_index :ahoy_visits, :started_at,
where: 'referring_domain IS NOT NULL',
algorithm: :concurrently,
name: 'index_ahoy_visits_started_at_with_referring_domain'
name: 'index_ahoy_visits_started_at_with_referring_domain',
if_not_exists: true
end
end