You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
docuseal/db/migrate/20260701165617_add_index_on...

18 lines
635 B

# frozen_string_literal: true
class AddIndexOnSubmissionsCompletedAt < ActiveRecord::Migration[8.1]
def change
add_index :submissions, %i[account_id completed_at],
where: 'completed_at IS NOT NULL AND archived_at IS NULL',
name: 'index_submissions_on_account_id_and_completed_at',
if_not_exists: true
return unless connection.supports_partial_index?
add_index :submissions, %i[account_id id],
where: 'completed_at IS NULL AND archived_at IS NULL',
name: 'index_submissions_on_account_id_and_id_pending',
if_not_exists: true
end
end