Browse Source

Fix migration error handling (#17991)

closed-social-glitch-2
Claire 2 years ago
committed by GitHub
parent
commit
cb45c04d26
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      lib/mastodon/migration_helpers.rb

+ 1
- 1
lib/mastodon/migration_helpers.rb View File

@ -812,7 +812,7 @@ module Mastodon
# removing the old one # removing the old one
def update_index(table_name, index_name, columns, **index_options) 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) if index_name_exists?(table_name, "#{index_name}_new") && index_name_exists?(table_name, index_name)
remove_index table_name, "#{index_name}_new"
remove_index table_name, name: "#{index_name}_new"
elsif index_name_exists?(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 # Very unlikely case where the script has been interrupted during/after removal but before renaming
rename_index table_name, "#{index_name}_new", index_name rename_index table_name, "#{index_name}_new", index_name

Loading…
Cancel
Save