Skip to content
Snippets Groups Projects
Unverified Commit 5f0fc639 authored by Claire's avatar Claire Committed by GitHub
Browse files

Fix error re-running some migrations if they get interrupted at the wrong moment (#17989)

parent 465ee779
No related branches found
No related tags found
No related merge requests found
......@@ -813,6 +813,9 @@ module Mastodon
def update_index(table_name, index_name, columns, **index_options)
if index_name_exists?(table_name, "#{index_name}_new") && index_name_exists?(table_name, index_name)
remove_index table_name, "#{index_name}_new"
elsif index_name_exists?(table_name, "#{index_name}_new")
# Very unlikely case where the script has been interrupted during/after removal but before renaming
rename_index table_name, "#{index_name}_new", index_name
end
begin
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment