feat: New APIs for search (#6564)

- Adding new API endpoints for search
- Migrations to add appropriate indexes
This commit is contained in:
Sojan Jose
2023-02-28 22:00:36 +05:30
committed by GitHub
parent 9bd47588fc
commit d4e7eaecce
18 changed files with 423 additions and 5 deletions

View File

@@ -10,10 +10,11 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2023_02_14_025901) do
ActiveRecord::Schema.define(version: 2023_02_24_124632) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_stat_statements"
enable_extension "pg_trgm"
enable_extension "pgcrypto"
enable_extension "plpgsql"
@@ -385,6 +386,7 @@ ActiveRecord::Schema.define(version: 2023_02_14_025901) do
t.index ["account_id"], name: "index_contacts_on_account_id"
t.index ["email", "account_id"], name: "uniq_email_per_account_contact", unique: true
t.index ["identifier", "account_id"], name: "uniq_identifier_per_account_contact", unique: true
t.index ["name", "email", "phone_number", "identifier"], name: "index_contacts_on_name_email_phone_number_identifier", opclass: :gin_trgm_ops, using: :gin
t.index ["phone_number", "account_id"], name: "index_contacts_on_phone_number_and_account_id"
end
@@ -631,7 +633,9 @@ ActiveRecord::Schema.define(version: 2023_02_14_025901) do
t.jsonb "external_source_ids", default: {}
t.jsonb "additional_attributes", default: {}
t.index "((additional_attributes -> 'campaign_id'::text))", name: "index_messages_on_additional_attributes_campaign_id", using: :gin
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"], name: "index_messages_on_conversation_id"
t.index ["inbox_id"], name: "index_messages_on_inbox_id"
t.index ["sender_type", "sender_id"], name: "index_messages_on_sender_type_and_sender_id"