diff options
author | Claire <claire.github-309c@sitedethib.com> | 2021-06-03 20:47:02 +0200 |
---|---|---|
committer | Claire <claire.github-309c@sitedethib.com> | 2021-06-03 20:47:02 +0200 |
commit | 0157caacefe34838ff5d5093dc188f5491cb7b15 (patch) | |
tree | a5b56590b7660b6ed3257f929bf209a26cb25a15 /lib/mastodon | |
parent | 02dffa8edd097014578774aed30249ed08d2f3a4 (diff) | |
parent | f6088922c06f3da02e9051b39f3a7111f19298dd (diff) |
Merge branch 'main' into glitch-soc/merge-upstream
Diffstat (limited to 'lib/mastodon')
-rw-r--r-- | lib/mastodon/maintenance_cli.rb | 2 | ||||
-rw-r--r-- | lib/mastodon/migration_helpers.rb | 14 | ||||
-rw-r--r-- | lib/mastodon/search_cli.rb | 2 | ||||
-rw-r--r-- | lib/mastodon/version.rb | 2 |
4 files changed, 17 insertions, 3 deletions
diff --git a/lib/mastodon/maintenance_cli.rb b/lib/mastodon/maintenance_cli.rb index 8e2084e33..47e2d78bb 100644 --- a/lib/mastodon/maintenance_cli.rb +++ b/lib/mastodon/maintenance_cli.rb @@ -14,7 +14,7 @@ module Mastodon end MIN_SUPPORTED_VERSION = 2019_10_01_213028 - MAX_SUPPORTED_VERSION = 2021_05_07_001928 + MAX_SUPPORTED_VERSION = 2021_05_26_193025 # Stubs to enjoy ActiveRecord queries while not depending on a particular # version of the code/database diff --git a/lib/mastodon/migration_helpers.rb b/lib/mastodon/migration_helpers.rb index 521d903bf..39a6e0680 100644 --- a/lib/mastodon/migration_helpers.rb +++ b/lib/mastodon/migration_helpers.rb @@ -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' diff --git a/lib/mastodon/search_cli.rb b/lib/mastodon/search_cli.rb index c0491744b..0126dfcff 100644 --- a/lib/mastodon/search_cli.rb +++ b/lib/mastodon/search_cli.rb @@ -102,7 +102,7 @@ module Mastodon ActiveRecord::Base.connection_pool.with_connection do grouped_records = type.adapter.send(:grouped_objects, records) - bulk_body = Chewy::Type::Import::BulkBuilder.new(type, grouped_records).bulk_body + bulk_body = Chewy::Type::Import::BulkBuilder.new(type, **grouped_records).bulk_body end index_count = grouped_records[:index].size if grouped_records.key?(:index) diff --git a/lib/mastodon/version.rb b/lib/mastodon/version.rb index ff0e694b7..00762f342 100644 --- a/lib/mastodon/version.rb +++ b/lib/mastodon/version.rb @@ -13,7 +13,7 @@ module Mastodon end def patch - 0 + 1 end def flags |