DEV: Add index to users.ip_address

This commit is contained in:
OsamaSayegh 2024-11-15 17:42:14 +03:00 committed by Michael Brown
parent 4efcc88039
commit a28ab171ec
2 changed files with 10 additions and 0 deletions

View File

@ -2295,6 +2295,7 @@ end
# Indexes
#
# idx_users_admin (id) WHERE admin
# idx_users_ip_address (ip_address)
# idx_users_moderator (id) WHERE moderator
# index_users_on_last_posted_at (last_posted_at)
# index_users_on_last_seen_at (last_seen_at)

View File

@ -0,0 +1,9 @@
# frozen_string_literal: true
class AddIndexToUsersIpAddress < ActiveRecord::Migration[7.1]
disable_ddl_transaction!
def change
add_index :users, :ip_address, algorithm: :concurrently, name: "idx_users_ip_address"
end
end