diff --git a/backend/src/userbot/modules/links/repository.py b/backend/src/userbot/modules/links/repository.py index 0fc4e6f..8db6489 100644 --- a/backend/src/userbot/modules/links/repository.py +++ b/backend/src/userbot/modules/links/repository.py @@ -7,6 +7,14 @@ INSERT INTO links (account_id, chat_id, message_id, position, url, kind, web_url, web_title, web_description, web_site_name, raw) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11::jsonb) +ON CONFLICT (account_id, chat_id, message_id, position) DO UPDATE SET + url = EXCLUDED.url, + kind = EXCLUDED.kind, + web_url = EXCLUDED.web_url, + web_title = EXCLUDED.web_title, + web_description = EXCLUDED.web_description, + web_site_name = EXCLUDED.web_site_name, + raw = EXCLUDED.raw """