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