mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-02 03:57:52 +00:00
feat: add index migration (#7050)
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
# index_messages_on_account_id_and_inbox_id (account_id,inbox_id)
|
||||
# index_messages_on_additional_attributes_campaign_id (((additional_attributes -> 'campaign_id'::text))) USING gin
|
||||
# index_messages_on_content (content) USING gin
|
||||
# index_messages_on_conversation_account_type_created (conversation_id,account_id,message_type,created_at)
|
||||
# index_messages_on_conversation_id (conversation_id)
|
||||
# index_messages_on_created_at (created_at)
|
||||
# index_messages_on_inbox_id (inbox_id)
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
class AddIndexToMessagesForReportings < ActiveRecord::Migration[7.0]
|
||||
disable_ddl_transaction!
|
||||
def change
|
||||
add_index :messages, [:conversation_id, :account_id, :message_type, :created_at], name: 'index_messages_on_conversation_account_type_created',
|
||||
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.0].define(version: 2023_05_09_101256) do
|
||||
ActiveRecord::Schema[7.0].define(version: 2023_05_10_060828) do
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "pg_stat_statements"
|
||||
enable_extension "pg_trgm"
|
||||
@@ -666,6 +666,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_05_09_101256) do
|
||||
t.index ["account_id", "inbox_id"], name: "index_messages_on_account_id_and_inbox_id"
|
||||
t.index ["account_id"], name: "index_messages_on_account_id"
|
||||
t.index ["content"], name: "index_messages_on_content", opclass: :gin_trgm_ops, using: :gin
|
||||
t.index ["conversation_id", "account_id", "message_type", "created_at"], name: "index_messages_on_conversation_account_type_created"
|
||||
t.index ["conversation_id"], name: "index_messages_on_conversation_id"
|
||||
t.index ["created_at"], name: "index_messages_on_created_at"
|
||||
t.index ["inbox_id"], name: "index_messages_on_inbox_id"
|
||||
|
||||
Reference in New Issue
Block a user