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

View file

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.0].define(version: 2023_10_07_090807) do
ActiveRecord::Schema[7.0].define(version: 2023_10_01_050733) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -108,7 +108,6 @@ ActiveRecord::Schema[7.0].define(version: 2023_10_07_090807) do
t.datetime "updated_at", precision: nil, null: false
t.datetime "last_status_at", precision: nil
t.integer "group_activitypub_count"
t.boolean "searchable_by_follower", default: false, null: false
t.index ["account_id"], name: "index_account_stats_on_account_id", unique: true
t.index ["last_status_at", "account_id"], name: "index_account_stats_on_last_status_at_and_account_id", order: { last_status_at: "DESC NULLS LAST" }
end
@ -585,7 +584,6 @@ ActiveRecord::Schema[7.0].define(version: 2023_10_07_090807) do
t.boolean "hidden_anonymous", default: false, null: false
t.boolean "detect_invalid_subscription", default: false, null: false
t.boolean "reject_reply_exclude_followers", default: false, null: false
t.boolean "reject_friend", default: false, null: false
t.index ["domain"], name: "index_domain_blocks_on_domain", unique: true
end
@ -678,23 +676,6 @@ ActiveRecord::Schema[7.0].define(version: 2023_10_07_090807) do
t.index ["target_account_id"], name: "index_follows_on_target_account_id"
end
create_table "friend_domains", force: :cascade do |t|
t.string "domain", default: "", null: false
t.string "inbox_url", default: "", null: false
t.integer "active_state", default: 0, null: false
t.integer "passive_state", default: 0, null: false
t.string "active_follow_activity_id"
t.string "passive_follow_activity_id"
t.boolean "available", default: true, null: false
t.boolean "public_unlisted", default: true, null: false
t.boolean "pseudo_relay", default: false, null: false
t.boolean "unlocked", default: false, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["domain"], name: "index_friend_domains_on_domain", unique: true
t.index ["inbox_url"], name: "index_friend_domains_on_inbox_url", unique: true
end
create_table "identities", force: :cascade do |t|
t.string "provider", default: "", null: false
t.string "uid", default: "", null: false