0
0
Fork 0

Audofix Rubocop Style/WordArray (#23739)

This commit is contained in:
Nick Schonning 2023-02-20 00:14:10 -05:00 committed by GitHub
parent 4552685f6b
commit bf785df9fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 27 additions and 50 deletions

View file

@ -6,7 +6,7 @@ class AddStatusesIndexOnAccountIdId < ActiveRecord::Migration[5.1]
# of an account to show them in his status page is one of the most
# significant examples.
# Add this index to improve the performance in such cases.
add_index 'statuses', ['account_id', 'id'], algorithm: :concurrently, name: 'index_statuses_on_account_id_id'
add_index 'statuses', %w(account_id id), algorithm: :concurrently, name: 'index_statuses_on_account_id_id'
remove_index 'statuses', algorithm: :concurrently, column: 'account_id', name: 'index_statuses_on_account_id'
end

View file

@ -10,6 +10,6 @@ class RevertIndexChangeOnStatusesForApiV1AccountsAccountIdStatuses < ActiveRecor
# These index may not exists (see migration 20180514130000)
remove_index :statuses, column: [:account_id, :id, :visibility], where: 'visibility IN (0, 1, 2)', algorithm: :concurrently if index_exists?(:statuses, [:account_id, :id, :visibility], where: 'visibility IN (0, 1, 2)')
remove_index :statuses, column: [:account_id, :id], where: 'visibility = 3', algorithm: :concurrently if index_exists?(:statuses, ['account_id', 'id'], where: '(visibility = 3)')
remove_index :statuses, column: [:account_id, :id], where: 'visibility = 3', algorithm: :concurrently if index_exists?(:statuses, %w(account_id id), where: '(visibility = 3)')
end
end