mirror of
https://github.com/abhinavxd/libredesk.git
synced 2026-09-22 02:23:32 +00:00
0c01b53b09
feat(messages): add trigram index for text content search - feat: UI animations for conversation and messages list. - Simplify websocket updates.
18 lines
551 B
SQL
18 lines
551 B
SQL
-- name: search-conversations
|
|
SELECT
|
|
conversations.created_at,
|
|
conversations.uuid,
|
|
conversations.reference_number,
|
|
conversations.subject
|
|
FROM conversations
|
|
WHERE reference_number::text = $1;
|
|
|
|
-- name: search-messages
|
|
SELECT
|
|
c.created_at as "conversation_created_at",
|
|
c.reference_number as "conversation_reference_number",
|
|
c.uuid as "conversation_uuid",
|
|
m.text_content
|
|
FROM conversation_messages m
|
|
JOIN conversations c ON m.conversation_id = c.id
|
|
WHERE m.type != 'activity' and m.text_content ILIKE '%' || $1 || '%'; |