add indexes to content tags and enrollments

Change-Id: Id3edd501c7f71dfd7b8240279451b700c095f8cc
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/232096
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
This commit is contained in:
James Williams 2020-03-30 09:01:37 -06:00
parent 1dc9628f98
commit 94f740b10e
2 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,9 @@
class AddActiveContentTagsIndex < ActiveRecord::Migration[5.2]
tag :postdeploy
disable_ddl_transaction!
def change
add_index :content_tags, [:context_id, :context_type, :content_type], where: "workflow_state = 'active'",
name: "index_content_tags_on_context_when_active", algorithm: :concurrently
end
end

View File

@ -0,0 +1,9 @@
class AddActiveEnrollmentsIndex < ActiveRecord::Migration[5.2]
tag :postdeploy
disable_ddl_transaction!
def change
add_index :enrollments, [:course_id], where: "workflow_state = 'active'",
name: "index_enrollments_on_course_when_active", algorithm: :concurrently
end
end