#
# Copyright (C) 2020 - 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 DropEnrollmentSectionIndex < ActiveRecord::Migration[5.2]
  tag :postdeploy

  def self.up
    remove_index :enrollments, [:course_section_id]
  end

  def self.down
    add_index :enrollments, [:course_section_id], algorithm: :concurrently
  end
end

Drop index on course_section_id from enrollments
Drop index on course_section_id from enrollments

closes: KNO-408

test plan
 - migrations should run
 - specs should pass

Change-Id: I3414d55110f9cb84e0d99d03796f0613081af7e1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/234401
Reviewed-by: James Williams <3a5f4ed991dbfa5c9ef76ad729d240ca12f62180@instructure.com>
Reviewed-by: Cody Cutrer <c4fe2b1d90ef8f2548c8aeabfa633434316f0305@instructure.com>
QA-Review: James Williams <3a5f4ed991dbfa5c9ef76ad729d240ca12f62180@instructure.com>
Product-Review: James Williams <3a5f4ed991dbfa5c9ef76ad729d240ca12f62180@instructure.com>
Tested-by: Service Cloud Jenkins <9144042a601061f88f1e1d7a1753ea3e2972119d@instructure.com>
