[deploy] Optimization:Add Index for User ID and Mailer to Ahoy Messages (#10175)

This commit is contained in:
Molly Struve 2020-09-03 12:18:07 -05:00 committed by GitHub
parent 1df3e96652
commit 636eddb1a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View file

@ -0,0 +1,7 @@
class AddUserIdMailerIndexToAhoyMessages < ActiveRecord::Migration[6.0]
disable_ddl_transaction!
def change
add_index :ahoy_messages, %i[user_id mailer], algorithm: :concurrently
end
end

View file

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2020_09_01_084210) do
ActiveRecord::Schema.define(version: 2020_09_02_204028) do
# These are extensions that must be enabled in order to support this database
enable_extension "citext"
@ -48,6 +48,7 @@ ActiveRecord::Schema.define(version: 2020_09_01_084210) do
t.string "utm_term"
t.index ["to"], name: "index_ahoy_messages_on_to"
t.index ["token"], name: "index_ahoy_messages_on_token"
t.index ["user_id", "mailer"], name: "index_ahoy_messages_on_user_id_and_mailer"
t.index ["user_id", "user_type"], name: "index_ahoy_messages_on_user_id_and_user_type"
end