recheck a partially applied index removal

refs CNVS-30214

test plan: migrations should run

Change-Id: I88be99b8f5f44f3ffea78530fd2960ee665401a7
Reviewed-on: https://gerrit.instructure.com/87530
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
This commit is contained in:
Simon Williams 2016-08-11 12:14:36 -06:00
parent 4508269e5a
commit 300dd5f8d9
2 changed files with 10 additions and 1 deletions

View File

@ -21,7 +21,7 @@ class UpdateIcuSortableNameIndex < ActiveRecord::Migration
connection.select_value("SELECT COUNT(*) FROM pg_proc WHERE proname='collkey'").to_i != 0
remove_index "users", :name => "index_users_on_sortable_name"
remove_index "users", :name => "index_attachments_on_folder_id_and_file_state_and_display_name"
remove_index "attachments", :name => "index_attachments_on_folder_id_and_file_state_and_display_name"
rename_index :users, 'index_users_on_sortable_name_old', 'index_users_on_sortable_name'
rename_index :attachments, 'index_attachments_on_folder_id_and_file_state_and_display_name2', 'index_attachments_on_folder_id_and_file_state_and_display_name'

View File

@ -0,0 +1,9 @@
class RedoPartiallyAppliedIndexes < ActiveRecord::Migration
tag :postdeploy
def up
if index_exists?(:attachments, [:folder_id, :file_state, :display_name], name: "index_attachments_on_folder_id_and_file_state_and_display_name2")
remove_index "attachments", name: "index_attachments_on_folder_id_and_file_state_and_display_name2"
end
end
end