nas/db/post_migrate/20240217215134_improve_remote_pending_accounts_index.rb
KMY(雪あすか) 0a6e68255f
Fix: アカウント一覧、カスタム絵文字一覧画面を高速化 (#585)
* Change: アカウント一覧、カスタム絵文字一覧でCOUNTを発行しないように

* Add index

* Fix test
2024-02-18 07:45:42 +09:00

11 lines
422 B
Ruby

# frozen_string_literal: true
class ImproveRemotePendingAccountsIndex < ActiveRecord::Migration[7.1]
disable_ddl_transaction!
def change
remove_index :accounts, :remote_pending, unique: false, algorithm: :concurrently
add_index :accounts, :id, name: 'index_remote_pending_users', unique: false, algorithm: :concurrently, where: 'domain IS NOT NULL AND remote_pending AND suspended_at IS NOT NULL'
end
end