diff --git a/db/migrate/20200820174703_add_partial_target_id_index_to_reviewables.rb b/db/migrate/20200820174703_add_partial_target_id_index_to_reviewables.rb new file mode 100644 index 00000000000..55d2bd81ac6 --- /dev/null +++ b/db/migrate/20200820174703_add_partial_target_id_index_to_reviewables.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddPartialTargetIdIndexToReviewables < ActiveRecord::Migration[6.0] + disable_ddl_transaction! + + def change + add_index :reviewables, [:target_id], where: "target_type = 'Post'", algorithm: :concurrently, name: "index_reviewables_on_target_id_where_post_type_eq_post" + end +end