add index

This commit is contained in:
Pete Matsyburka
2025-06-17 10:37:25 +03:00
parent 2aece98d67
commit d8bf2cc101
7 changed files with 38 additions and 10 deletions
@@ -0,0 +1,8 @@
# frozen_string_literal: true
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')"
end
end
@@ -0,0 +1,7 @@
# frozen_string_literal: true
class AddTemplatesFolderIndex < ActiveRecord::Migration[8.0]
def change
add_index :templates, %i[account_id folder_id id], where: 'archived_at IS NULL'
end
end
@@ -0,0 +1,7 @@
# frozen_string_literal: true
class AddSubmissionsTemplateIndex < ActiveRecord::Migration[8.0]
def change
add_index :submissions, %i[account_id template_id id], where: 'archived_at IS NULL'
end
end