Files
codeocean/db/migrate/20230314084733_add_index_for_recommended_rfcs.rb
Sebastian Serth 417ead3d3f Reduce SQL queries to find a unsolved recommended RfC
Fixes CODEOCEAN-JQ
2023-03-14 13:56:23 +01:00

8 lines
311 B
Ruby

# frozen_string_literal: true
class AddIndexForRecommendedRfcs < ActiveRecord::Migration[7.0]
def change
add_index :request_for_comments, %i[exercise_id created_at], where: "(NOT solved OR solved IS NULL) AND (question IS NOT NULL AND question <> '')", name: :index_unresolved_recommended_rfcs
end
end