0
0
Fork 0

Fix migration script not being able to run if it fails midway (#16312)

* Fix migration script not being able to run if it fails midway

* Fix old migration script

* Fix old migration script

* Refactor CorruptionError
This commit is contained in:
Claire 2021-06-02 19:15:17 +02:00 committed by GitHub
parent 526332c545
commit 11d3c065a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 39 additions and 13 deletions

View file

@ -41,6 +41,20 @@
module Mastodon
module MigrationHelpers
class CorruptionError < StandardError
def initialize(message = nil)
super(message.presence || 'Migration failed because of index corruption, see https://docs.joinmastodon.org/admin/troubleshooting/index-corruption/#fixing')
end
def cause
nil
end
def backtrace
[]
end
end
# Model that can be used for querying permissions of a SQL user.
class Grant < ActiveRecord::Base
self.table_name = 'information_schema.role_table_grants'