Fix: quote_of_idのインデックス

This commit is contained in:
KMY 2023-10-22 17:27:17 +09:00 committed by KMY(雪あすか)
parent 67eced5a98
commit 1fc8032bdf
2 changed files with 15 additions and 1 deletions

View file

@ -0,0 +1,13 @@
# frozen_string_literal: true
require Rails.root.join('lib', 'mastodon', 'migration_helpers')
class AddStatusesQuoteIndex < ActiveRecord::Migration[7.0]
include Mastodon::MigrationHelpers
disable_ddl_transaction!
def change
safety_assured { add_index :statuses, [:quote_of_id, :account_id], unique: false }
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_21_005339) do
ActiveRecord::Schema[7.0].define(version: 2023_10_22_074913) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -1228,6 +1228,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_10_21_005339) do
t.index ["id", "account_id"], name: "index_statuses_public_20200119", order: { id: :desc }, where: "((deleted_at IS NULL) AND (visibility = 0) AND (reblog_of_id IS NULL) AND ((NOT reply) OR (in_reply_to_account_id = account_id)))"
t.index ["in_reply_to_account_id"], name: "index_statuses_on_in_reply_to_account_id", where: "(in_reply_to_account_id IS NOT NULL)"
t.index ["in_reply_to_id"], name: "index_statuses_on_in_reply_to_id", where: "(in_reply_to_id IS NOT NULL)"
t.index ["quote_of_id", "account_id"], name: "index_statuses_on_quote_of_id_and_account_id"
t.index ["reblog_of_id", "account_id"], name: "index_statuses_on_reblog_of_id_and_account_id"
t.index ["uri"], name: "index_statuses_on_uri", unique: true, opclass: :text_pattern_ops, where: "(uri IS NOT NULL)"
end