mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-29 14:35:06 +01:00
Disable Naming/VariableNumber
cop in old migrations (#33274)
This commit is contained in:
parent
6445facb8c
commit
d56aa9031a
@ -1,8 +1,5 @@
|
|||||||
inherit_from: ../../.rubocop.yml
|
inherit_from: ../../.rubocop.yml
|
||||||
|
|
||||||
Naming/VariableNumber:
|
|
||||||
CheckSymbols: false
|
|
||||||
|
|
||||||
# Below are all enabled as workaround for https://docs.rubocop.org/rubocop/configuration.html#path-relativity
|
# Below are all enabled as workaround for https://docs.rubocop.org/rubocop/configuration.html#path-relativity
|
||||||
# TODO: Delete this file and move above config to base naming config
|
# TODO: Delete this file and move above config to base naming config
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ class AddIndexOnStatusesForApiV1AccountsAccountIdStatuses < ActiveRecord::Migrat
|
|||||||
|
|
||||||
def change
|
def change
|
||||||
safety_assured do
|
safety_assured do
|
||||||
add_index :statuses, [:account_id, :id, :visibility, :updated_at], order: { id: :desc }, algorithm: :concurrently, name: :index_statuses_20180106
|
add_index :statuses, [:account_id, :id, :visibility, :updated_at], order: { id: :desc }, algorithm: :concurrently, name: :index_statuses_20180106 # rubocop:disable Naming/VariableNumber
|
||||||
end
|
end
|
||||||
remove_index :statuses, [:account_id, :id], name: :index_statuses_on_account_id_id
|
remove_index :statuses, [:account_id, :id], name: :index_statuses_on_account_id_id
|
||||||
end
|
end
|
||||||
|
@ -5,7 +5,7 @@ class RevertIndexChangeOnStatusesForApiV1AccountsAccountIdStatuses < ActiveRecor
|
|||||||
|
|
||||||
def change
|
def change
|
||||||
safety_assured do
|
safety_assured do
|
||||||
add_index :statuses, [:account_id, :id, :visibility, :updated_at], order: { id: :desc }, algorithm: :concurrently, name: :index_statuses_20180106 unless index_name_exists?(:statuses, 'index_statuses_20180106')
|
add_index :statuses, [:account_id, :id, :visibility, :updated_at], order: { id: :desc }, algorithm: :concurrently, name: :index_statuses_20180106 unless index_name_exists?(:statuses, 'index_statuses_20180106') # rubocop:disable Naming/VariableNumber
|
||||||
end
|
end
|
||||||
|
|
||||||
# These index may not exists (see migration 20180514130000)
|
# These index may not exists (see migration 20180514130000)
|
||||||
|
@ -4,12 +4,12 @@ class UpdateStatusesIndex < ActiveRecord::Migration[5.2]
|
|||||||
disable_ddl_transaction!
|
disable_ddl_transaction!
|
||||||
|
|
||||||
def up
|
def up
|
||||||
safety_assured { add_index :statuses, [:account_id, :id, :visibility, :updated_at], where: 'deleted_at IS NULL', order: { id: :desc }, algorithm: :concurrently, name: :index_statuses_20190820 }
|
safety_assured { add_index :statuses, [:account_id, :id, :visibility, :updated_at], where: 'deleted_at IS NULL', order: { id: :desc }, algorithm: :concurrently, name: :index_statuses_20190820 } # rubocop:disable Naming/VariableNumber
|
||||||
remove_index :statuses, name: :index_statuses_20180106
|
remove_index :statuses, name: :index_statuses_20180106 # rubocop:disable Naming/VariableNumber
|
||||||
end
|
end
|
||||||
|
|
||||||
def down
|
def down
|
||||||
safety_assured { add_index :statuses, [:account_id, :id, :visibility, :updated_at], order: { id: :desc }, algorithm: :concurrently, name: :index_statuses_20180106 }
|
safety_assured { add_index :statuses, [:account_id, :id, :visibility, :updated_at], order: { id: :desc }, algorithm: :concurrently, name: :index_statuses_20180106 } # rubocop:disable Naming/VariableNumber
|
||||||
remove_index :statuses, name: :index_statuses_20190820
|
remove_index :statuses, name: :index_statuses_20190820 # rubocop:disable Naming/VariableNumber
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -4,10 +4,10 @@ class AddLocalIndexToStatuses < ActiveRecord::Migration[5.2]
|
|||||||
disable_ddl_transaction!
|
disable_ddl_transaction!
|
||||||
|
|
||||||
def up
|
def up
|
||||||
add_index :statuses, [:id, :account_id], name: :index_statuses_local_20190824, algorithm: :concurrently, order: { id: :desc }, where: '(local OR (uri IS NULL)) AND deleted_at IS NULL AND visibility = 0 AND reblog_of_id IS NULL AND ((NOT reply) OR (in_reply_to_account_id = account_id))'
|
add_index :statuses, [:id, :account_id], name: :index_statuses_local_20190824, algorithm: :concurrently, order: { id: :desc }, where: '(local OR (uri IS NULL)) AND deleted_at IS NULL AND visibility = 0 AND reblog_of_id IS NULL AND ((NOT reply) OR (in_reply_to_account_id = account_id))' # rubocop:disable Naming/VariableNumber
|
||||||
end
|
end
|
||||||
|
|
||||||
def down
|
def down
|
||||||
remove_index :statuses, name: :index_statuses_local_20190824
|
remove_index :statuses, name: :index_statuses_local_20190824 # rubocop:disable Naming/VariableNumber
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -4,10 +4,10 @@ class AddPublicIndexToStatuses < ActiveRecord::Migration[5.2]
|
|||||||
disable_ddl_transaction!
|
disable_ddl_transaction!
|
||||||
|
|
||||||
def up
|
def up
|
||||||
add_index :statuses, [:id, :account_id], name: :index_statuses_public_20200119, algorithm: :concurrently, order: { id: :desc }, where: 'deleted_at IS NULL AND visibility = 0 AND reblog_of_id IS NULL AND ((NOT reply) OR (in_reply_to_account_id = account_id))'
|
add_index :statuses, [:id, :account_id], name: :index_statuses_public_20200119, algorithm: :concurrently, order: { id: :desc }, where: 'deleted_at IS NULL AND visibility = 0 AND reblog_of_id IS NULL AND ((NOT reply) OR (in_reply_to_account_id = account_id))' # rubocop:disable Naming/VariableNumber
|
||||||
end
|
end
|
||||||
|
|
||||||
def down
|
def down
|
||||||
remove_index :statuses, name: :index_statuses_public_20200119
|
remove_index :statuses, name: :index_statuses_public_20200119 # rubocop:disable Naming/VariableNumber
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user