Revert "#66 検索時のフォロー中アカウント一覧作成処理を改善"

This reverts commit 22d1f52597.
This commit is contained in:
KMY 2023-10-07 21:33:52 +09:00
parent 9738d80cb4
commit 87afb5295a
7 changed files with 5 additions and 90 deletions

View file

@ -1,20 +0,0 @@
# frozen_string_literal: true
require Rails.root.join('lib', 'mastodon', 'migration_helpers')
class AddSearchableFollowToAccountStats < ActiveRecord::Migration[7.0]
include Mastodon::MigrationHelpers
disable_ddl_transaction!
class AccountStat < ApplicationRecord; end
def change
safety_assured do
add_column_with_default :account_stats, :searchable_by_follower, :boolean, default: false, allow_null: false
AccountStat.where('EXISTS (SELECT 1 FROM statuses WHERE searchability IN (0, 10, 1) AND account_id = account_stats.account_id)')
.update_all(searchable_by_follower: true) # rubocop:disable Rails/SkipsModelValidations
end
end
end