@ -160,6 +160,7 @@ module Mastodon
deduplicate_tags!
deduplicate_tags!
deduplicate_webauthn_credentials!
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
Rails . cache . clear
@prompt . say 'Finished!'
@prompt . say 'Finished!'
@ -188,6 +189,11 @@ module Mastodon
else
else
ActiveRecord :: Base . connection . add_index :accounts , " lower (username), COALESCE(lower(domain), '') " , name : 'index_accounts_on_username_and_domain_lower' , unique : true
ActiveRecord :: Base . connection . add_index :accounts , " lower (username), COALESCE(lower(domain), '') " , name : 'index_accounts_on_username_and_domain_lower' , unique : true
end
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
end
def deduplicate_users!
def deduplicate_users!