2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-04-26 04:11:39 -04:00
|
|
|
class AddMissingUserDestroyerIndexes < ActiveRecord::Migration[5.2]
|
|
|
|
def change
|
|
|
|
# these indexes are required to make deletions of users fast
|
|
|
|
add_index :user_actions, [:target_user_id], where: "target_user_id IS NOT NULL"
|
|
|
|
add_index :post_actions, [:user_id]
|
|
|
|
add_index :user_uploads, %i[user_id upload_id]
|
|
|
|
add_index :user_auth_token_logs, [:user_id]
|
2019-04-26 04:14:28 -04:00
|
|
|
add_index :topic_links, [:user_id]
|
2019-04-26 04:11:39 -04:00
|
|
|
end
|
|
|
|
end
|