#18 Add sql index for unpublished exercises

And remove spec for remove feature
This commit is contained in:
Maximilian Pass
2020-12-15 12:17:11 +01:00
committed by Felix Auringer
parent 2d2869765f
commit 028fc2989a
13 changed files with 148 additions and 1 deletions

View File

@@ -0,0 +1,6 @@
class AddIndexToRfc < ActiveRecord::Migration[5.2]
def change
add_index(:request_for_comments, %i[user_id user_type created_at],
order: { user_id: :asc, user_type: :asc, created_at: :desc }, name: :index_rfc_on_user_and_created_at)
end
end

View File

@@ -0,0 +1,5 @@
class AddIndexToUnpublishedExercises < ActiveRecord::Migration[5.2]
def change
add_index(:exercises, :id, where: 'NOT unpublished', name: :index_unpublished_exercises)
end
end

View File

@@ -0,0 +1,6 @@
class AddIndexToExerciseTitle < ActiveRecord::Migration[5.2]
def change
enable_extension 'pg_trgm'
add_index :exercises, :title, using: :gin, opclass: :gin_trgm_ops
end
end