feat: Add a view for mentions (#3505)
- Added a new table mentions for saving user mentions - Added a filter conversation_type in the API - Added a view to see the mentions
This commit is contained in:
13
db/migrate/20211201224513_create_mentions.rb
Normal file
13
db/migrate/20211201224513_create_mentions.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
class CreateMentions < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
create_table :mentions do |t|
|
||||
t.references :user, null: false, foreign_key: true
|
||||
t.references :conversation, null: false, foreign_key: true
|
||||
t.references :account, index: true, null: false
|
||||
t.datetime :mentioned_at, null: false
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :mentions, [:user_id, :conversation_id], unique: true
|
||||
end
|
||||
end
|
||||
15
db/schema.rb
15
db/schema.rb
@@ -531,6 +531,19 @@ ActiveRecord::Schema.define(version: 2021_12_08_085931) do
|
||||
t.index ["title", "account_id"], name: "index_labels_on_title_and_account_id", unique: true
|
||||
end
|
||||
|
||||
create_table "mentions", force: :cascade do |t|
|
||||
t.bigint "user_id", null: false
|
||||
t.bigint "conversation_id", null: false
|
||||
t.bigint "account_id", null: false
|
||||
t.datetime "mentioned_at", null: false
|
||||
t.datetime "created_at", precision: 6, null: false
|
||||
t.datetime "updated_at", precision: 6, null: false
|
||||
t.index ["account_id"], name: "index_mentions_on_account_id"
|
||||
t.index ["conversation_id"], name: "index_mentions_on_conversation_id"
|
||||
t.index ["user_id", "conversation_id"], name: "index_mentions_on_user_id_and_conversation_id", unique: true
|
||||
t.index ["user_id"], name: "index_mentions_on_user_id"
|
||||
end
|
||||
|
||||
create_table "messages", id: :serial, force: :cascade do |t|
|
||||
t.text "content"
|
||||
t.integer "account_id", null: false
|
||||
@@ -764,6 +777,8 @@ ActiveRecord::Schema.define(version: 2021_12_08_085931) do
|
||||
add_foreign_key "csat_survey_responses", "messages"
|
||||
add_foreign_key "csat_survey_responses", "users", column: "assigned_agent_id"
|
||||
add_foreign_key "data_imports", "accounts"
|
||||
add_foreign_key "mentions", "conversations"
|
||||
add_foreign_key "mentions", "users"
|
||||
add_foreign_key "notes", "accounts"
|
||||
add_foreign_key "notes", "contacts"
|
||||
add_foreign_key "notes", "users"
|
||||
|
||||
Reference in New Issue
Block a user