Fix: ancestor_status_id
検索によるDB負荷 (#318)
This commit is contained in:
parent
a88349af55
commit
eb7cf381ba
2 changed files with 11 additions and 1 deletions
|
@ -0,0 +1,9 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddIndexOnConversationsAncestorStatusId < ActiveRecord::Migration[7.1]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def change
|
||||
add_index :conversations, :ancestor_status_id, where: 'ancestor_status_id IS NOT NULL', algorithm: :concurrently
|
||||
end
|
||||
end
|
|
@ -10,7 +10,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[7.1].define(version: 2023_11_15_001356) do
|
||||
ActiveRecord::Schema[7.1].define(version: 2023_11_30_031209) do
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
||||
|
@ -477,6 +477,7 @@ ActiveRecord::Schema[7.1].define(version: 2023_11_15_001356) do
|
|||
t.datetime "updated_at", precision: nil, null: false
|
||||
t.string "inbox_url"
|
||||
t.bigint "ancestor_status_id"
|
||||
t.index ["ancestor_status_id"], name: "index_conversations_on_ancestor_status_id", where: "(ancestor_status_id IS NOT NULL)"
|
||||
t.index ["uri"], name: "index_conversations_on_uri", unique: true, opclass: :text_pattern_ops, where: "(uri IS NOT NULL)"
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue