#66 検索時のフォロー中アカウント一覧作成処理を改善
This commit is contained in:
parent
583f5fe906
commit
22d1f52597
7 changed files with 90 additions and 5 deletions
|
@ -0,0 +1,20 @@
|
|||
# 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
|
21
db/schema.rb
21
db/schema.rb
|
@ -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_01_050733) do
|
||||
ActiveRecord::Schema[7.0].define(version: 2023_10_07_090807) do
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
||||
|
@ -108,6 +108,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_10_01_050733) 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
|
||||
|
@ -584,6 +585,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_10_01_050733) 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
|
||||
|
||||
|
@ -676,6 +678,23 @@ ActiveRecord::Schema[7.0].define(version: 2023_10_01_050733) 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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue