adjust indexes
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
class AddEmailEventsEventTypeIndex < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
add_index :email_events, %i[event_type email],
|
||||
where: "event_type IN ('bounce', 'soft_bounce', 'complaint', 'soft_complaint')"
|
||||
add_index :email_events, :email, where: "event_type IN ('bounce', 'soft_bounce', 'complaint', 'soft_complaint')",
|
||||
name: 'index_email_events_on_email_event_types'
|
||||
end
|
||||
end
|
||||
|
||||
@@ -3,5 +3,8 @@
|
||||
class AddSubmissionsTemplateIndex < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
add_index :submissions, %i[account_id template_id id], where: 'archived_at IS NULL'
|
||||
add_index :submissions, %i[account_id template_id id],
|
||||
where: 'archived_at IS NOT NULL',
|
||||
name: 'index_submissions_on_account_id_and_template_id_and_id_archived'
|
||||
end
|
||||
end
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddArchivedTemplatesIndex < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
add_index :templates, %i[account_id id], where: 'archived_at IS NOT NULL',
|
||||
name: 'index_templates_on_account_id_and_id_archived'
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user