add index on content_tags to make lookup / bulk updating easier

flag=none

Test plan:
 - Already tested: https://instructure.slack.com/archives/C0292K3J1/p1676774757040499

Change-Id: Id9c7f05cf7996d6aaf1c1529d2d95df3a26fcc67
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/311485
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Alex Slaughter <aslaughter@instructure.com>
Product-Review: Alex Slaughter <aslaughter@instructure.com>
This commit is contained in:
Alex Slaughter 2023-02-19 00:33:39 -07:00
parent 6249f7a314
commit dbaf24a057
1 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,28 @@
# frozen_string_literal: true
#
# Copyright (C) 2023 - present Instructure, Inc.
#
# This file is part of Canvas.
#
# Canvas is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, version 3 of the License.
#
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
class IndexContentTag < ActiveRecord::Migration[6.1]
tag :postdeploy
disable_ddl_transaction!
def change
add_index :content_tags, %i[content_id content_type url], algorithm: :concurrently, if_not_exists: true
end
end