diff --git a/lib/mastodon/cli/maintenance.rb b/lib/mastodon/cli/maintenance.rb index d0eff7da6..553ca056d 100644 --- a/lib/mastodon/cli/maintenance.rb +++ b/lib/mastodon/cli/maintenance.rb @@ -712,7 +712,7 @@ module Mastodon::CLI end def remove_index_if_exists!(table, name) - ActiveRecord::Base.connection.remove_index(table, name: name) + ActiveRecord::Base.connection.remove_index(table, name: name) if ActiveRecord::Base.connection.index_name_exists?(table, name) rescue ArgumentError, ActiveRecord::StatementInvalid nil end