feat: add conversation summary fields

This commit is contained in:
Shivam Mishra
2023-07-17 13:38:09 +05:30
parent 91c1061214
commit 0b37e11ebf
3 changed files with 27 additions and 3 deletions
+2
View File
@@ -14,6 +14,8 @@
# priority :integer
# snoozed_until :datetime
# status :integer default("open"), not null
# summary :string
# summary_generated_at :datetime
# uuid :uuid not null
# waiting_since :datetime
# created_at :datetime not null
@@ -0,0 +1,6 @@
class AddSummaryFieldsToConversations < ActiveRecord::Migration[7.0]
def change
add_column :conversations, :summary, :string
add_column :conversations, :summary_generated_at, :datetime
end
end
+19 -3
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_07_14_054138) do
ActiveRecord::Schema[7.0].define(version: 2023_07_17_075819) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_stat_statements"
enable_extension "pg_trgm"
@@ -449,8 +449,10 @@ ActiveRecord::Schema[7.0].define(version: 2023_07_14_054138) do
t.datetime "assignee_last_seen_at", precision: nil
t.datetime "first_reply_created_at", precision: nil
t.integer "priority"
t.bigint "sla_policy_id"
t.datetime "waiting_since"
t.bigint "sla_policy_id"
t.string "summary"
t.datetime "summary_generated_at"
t.index ["account_id", "display_id"], name: "index_conversations_on_account_id_and_display_id", unique: true
t.index ["account_id", "id"], name: "index_conversations_on_id_and_account_id"
t.index ["account_id", "inbox_id", "status", "assignee_id"], name: "conv_acid_inbid_stat_asgnid_idx"
@@ -585,8 +587,8 @@ ActiveRecord::Schema[7.0].define(version: 2023_07_14_054138) do
t.jsonb "auto_assignment_config", default: {}
t.boolean "lock_to_single_conversation", default: false, null: false
t.bigint "portal_id"
t.string "business_name"
t.integer "sender_name_type", default: 0, null: false
t.string "business_name"
t.index ["account_id"], name: "index_inboxes_on_account_id"
t.index ["channel_id", "channel_type"], name: "index_inboxes_on_channel_id_and_channel_type"
t.index ["portal_id"], name: "index_inboxes_on_portal_id"
@@ -615,6 +617,19 @@ ActiveRecord::Schema[7.0].define(version: 2023_07_14_054138) do
t.jsonb "settings", default: {}
end
create_table "label_associations", force: :cascade do |t|
t.bigint "label_id", null: false
t.string "labelable_type", null: false
t.bigint "labelable_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["label_id"], name: "index_label_associations_on_label_id"
t.index ["labelable_type", "labelable_id"], name: "index_label_associations_on_contact", where: "((labelable_type)::text = 'Contact'::text)"
t.index ["labelable_type", "labelable_id"], name: "index_label_associations_on_conversation", where: "((labelable_type)::text = 'Conversation'::text)"
t.index ["labelable_type", "labelable_id"], name: "index_label_associations_on_labelable"
t.index ["labelable_type", "labelable_id"], name: "index_label_associations_on_labelable_type_and_labelable_id"
end
create_table "labels", force: :cascade do |t|
t.string "title"
t.text "description"
@@ -944,6 +959,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_07_14_054138) do
add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
add_foreign_key "inboxes", "portals"
add_foreign_key "label_associations", "labels"
create_trigger("accounts_after_insert_row_tr", :generated => true, :compatibility => 1).
on("accounts").
after(:insert).