Add some missing indexes on foreign keys (#18157)
parent
0f11d6ee6d
commit
a9b2368115
@ -0,0 +1,7 @@
|
||||
class AddIndexStatusesOnAccountId < ActiveRecord::Migration[6.1]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def change
|
||||
add_index :statuses, [:account_id], name: :index_statuses_on_account_id, algorithm: :concurrently
|
||||
end
|
||||
end
|
@ -0,0 +1,7 @@
|
||||
class AddIndexStatusesPinsOnStatusId < ActiveRecord::Migration[6.1]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def change
|
||||
add_index :status_pins, [:status_id], name: :index_status_pins_on_status_id, algorithm: :concurrently
|
||||
end
|
||||
end
|
@ -0,0 +1,7 @@
|
||||
class AddIndexReportsOnAssignedAccountId < ActiveRecord::Migration[6.1]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def change
|
||||
add_index :reports, [:assigned_account_id], name: :index_reports_on_assigned_account_id, algorithm: :concurrently, where: 'assigned_account_id IS NOT NULL'
|
||||
end
|
||||
end
|
@ -0,0 +1,7 @@
|
||||
class AddIndexReportsOnActionTakenByAccountId < ActiveRecord::Migration[6.1]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def change
|
||||
add_index :reports, [:action_taken_by_account_id], name: :index_reports_on_action_taken_by_account_id, algorithm: :concurrently, where: 'action_taken_by_account_id IS NOT NULL'
|
||||
end
|
||||
end
|
Loading…
Reference in new issue