소스 검색

Fix maintenance script not re-indexing some indexes on textual values (#15515)

* Fix maintenance script not re-indexing some indexes on textual values

Fixes #15475

* Refresh instance view at the end of the maintenance script run

Co-authored-by: Claire <claire.github-309c@sitedethib.com>
pull/15527/head
ThibG 3 달 전
committed by GitHub
부모
커밋
9395143126
No known key found for this signature in database GPG 키 ID: 4AEE18F83AFDEB23
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. +6
    -0
      lib/mastodon/maintenance_cli.rb

+ 6
- 0
lib/mastodon/maintenance_cli.rb 파일 보기

@@ -160,6 +160,7 @@ module Mastodon
deduplicate_tags!
deduplicate_webauthn_credentials!

Scenic.database.refresh_materialized_view('instances', concurrently: true, cascade: false) if ActiveRecord::Migrator.current_version >= 2020_12_06_004238
Rails.cache.clear

@prompt.say 'Finished!'
@@ -188,6 +189,11 @@ module Mastodon
else
ActiveRecord::Base.connection.add_index :accounts, "lower (username), COALESCE(lower(domain), '')", name: 'index_accounts_on_username_and_domain_lower', unique: true
end

@prompt.say 'Reindexing textual indexes on accounts…'
ActiveRecord::Base.connection.execute('REINDEX INDEX search_index;')
ActiveRecord::Base.connection.execute('REINDEX INDEX index_accounts_on_uri;')
ActiveRecord::Base.connection.execute('REINDEX INDEX index_accounts_on_url;')
end

def deduplicate_users!


불러오는 중...
취소
저장