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:
parent
526332c545
commit
11d3c065a5
4 changed files with 39 additions and 13 deletions
|
@ -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'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue