diff --git a/db/migrate/20221012135202_add_index_to_custom_values.rb b/db/migrate/20221012135202_add_index_to_custom_values.rb new file mode 100644 index 000000000..b6580122e --- /dev/null +++ b/db/migrate/20221012135202_add_index_to_custom_values.rb @@ -0,0 +1,8 @@ +class AddIndexToCustomValues < ActiveRecord::Migration[6.1] + def change + say_with_time 'Adding unique index on custom_values, this may take some time...' do + add_index :custom_values, [:customized_type, :customized_id, :custom_field_id], name: :custom_values_customized_custom_field + remove_index :custom_values, column: [:customized_type, :customized_id], name: :custom_values_customized + end + end +end