add index on error_reports.user_id

Change-Id: I3174c8cf81c135a74c3c1b56c78acb7b7410ae06
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/338754
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
This commit is contained in:
Cody Cutrer 2024-01-25 14:40:42 -07:00
parent db8b9c1622
commit 01e86ec800
1 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,27 @@
# frozen_string_literal: true
#
# Copyright (C) 2024 - 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 AddErrorReportsUserIdIndex < ActiveRecord::Migration[7.0]
tag :postdeploy
disable_ddl_transaction!
def change
add_index :error_reports, :user_id, algorithm: :concurrently, if_not_exists: true, where: "user_id IS NOT NULL"
end
end