* feat: add priority * feat: add indexes
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
# first_reply_created_at :datetime
|
||||
# identifier :string
|
||||
# last_activity_at :datetime not null
|
||||
# priority :integer
|
||||
# snoozed_until :datetime
|
||||
# status :integer default("open"), not null
|
||||
# uuid :uuid not null
|
||||
@@ -38,7 +39,9 @@
|
||||
# index_conversations_on_id_and_account_id (account_id,id)
|
||||
# index_conversations_on_inbox_id (inbox_id)
|
||||
# index_conversations_on_last_activity_at (last_activity_at)
|
||||
# index_conversations_on_priority (priority)
|
||||
# index_conversations_on_status_and_account_id (status,account_id)
|
||||
# index_conversations_on_status_and_priority (status,priority)
|
||||
# index_conversations_on_team_id (team_id)
|
||||
# index_conversations_on_uuid (uuid) UNIQUE
|
||||
#
|
||||
@@ -61,6 +64,7 @@ class Conversation < ApplicationRecord
|
||||
validate :validate_referer_url
|
||||
|
||||
enum status: { open: 0, resolved: 1, pending: 2, snoozed: 3 }
|
||||
enum priority: { low: 0, medium: 1, high: 2, urgent: 3 }
|
||||
|
||||
scope :unassigned, -> { where(assignee_id: nil) }
|
||||
scope :assigned, -> { where.not(assignee_id: nil) }
|
||||
|
||||
Reference in New Issue
Block a user