mirror of
https://github.com/mastodon/mastodon.git
synced 2025-01-03 15:52:34 +01:00
Only attempt to remove indexes that exist in CLI::Maintenance
script (#28286)
This commit is contained in:
parent
f5d6143aa1
commit
253393f3a8
1 changed files with 1 additions and 1 deletions
|
@ -712,7 +712,7 @@ module Mastodon::CLI
|
||||||
end
|
end
|
||||||
|
|
||||||
def remove_index_if_exists!(table, name)
|
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
|
rescue ArgumentError, ActiveRecord::StatementInvalid
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue