populate completed_at
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
# 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
|
||||
Reference in New Issue
Block a user