Merge commit '42ab855b2339c5cea3229c856ab539f883736b12' into glitch-soc/merge-upstream

Conflicts:
- `app/controllers/auth/confirmations_controller.rb`:
  Upstream refactored, changing lines textually close of glitch-soc-only lines
  pertaining to the theming system.
  Resolved the conflict.
- `app/controllers/auth/passwords_controller.rb`:
  Upstream refactored, changing lines textually close of glitch-soc-only lines
  pertaining to the theming system.
  Resolved the conflict.
- `app/controllers/settings/two_factor_authentication/webauthn_credentials_controller.rb`:
  Upstream refactored, changing lines textually close of glitch-soc-only lines
  pertaining to the theming system.
  Resolved the conflict.
This commit is contained in:
Claire
2024-01-27 19:06:41 +01:00
11 changed files with 164 additions and 44 deletions

View File

@@ -244,10 +244,10 @@ module Mastodon::CLI
end
say 'Reindexing textual indexes on accounts…'
database_connection.execute('REINDEX INDEX search_index;')
database_connection.execute('REINDEX INDEX index_accounts_on_uri;')
database_connection.execute('REINDEX INDEX index_accounts_on_url;')
database_connection.execute('REINDEX INDEX index_accounts_on_domain_and_id;') if migrator_version >= 2023_05_24_190515
rebuild_index(:search_index)
rebuild_index(:index_accounts_on_uri)
rebuild_index(:index_accounts_on_url)
rebuild_index(:index_accounts_on_domain_and_id) if migrator_version >= 2023_05_24_190515
end
def deduplicate_users!
@@ -274,7 +274,7 @@ module Mastodon::CLI
database_connection.add_index :users, ['reset_password_token'], name: 'index_users_on_reset_password_token', unique: true, where: 'reset_password_token IS NOT NULL', opclass: :text_pattern_ops
end
database_connection.execute('REINDEX INDEX index_users_on_unconfirmed_email;') if migrator_version >= 2023_07_02_151753
rebuild_index(:index_users_on_unconfirmed_email) if migrator_version >= 2023_07_02_151753
end
def deduplicate_users_process_email
@@ -735,5 +735,9 @@ module Mastodon::CLI
def db_table_exists?(table)
database_connection.table_exists?(table)
end
def rebuild_index(name)
database_connection.execute("REINDEX INDEX #{name}")
end
end
end