Browse Source

Add an index to improve the performance of issue queries involving custom fields (#29171).

Contributed by Stephane Evr.


git-svn-id: https://svn.redmine.org/redmine/trunk@21955 e93f8b46-1217-0410-a6f0-8f06a7374b81
tags/5.1.0
Go MAEDA 1 year ago
parent
commit
09f6fcd49c
1 changed files with 6 additions and 0 deletions
  1. 6
    0
      db/migrate/20221012135202_add_index_to_custom_values.rb

+ 6
- 0
db/migrate/20221012135202_add_index_to_custom_values.rb View File

@@ -0,0 +1,6 @@
class AddIndexToCustomValues < ActiveRecord::Migration[6.1]
def change
remove_index :custom_values, column: [:customized_type, :customized_id], name: :custom_values_customized, if_exists: true
add_index :custom_values, [:customized_type, :customized_id, :custom_field_id], name: :custom_values_customized_custom_field
end
end

Loading…
Cancel
Save