Allow domains to belong to multiple third parties

Change the unique constraint on common_third_party_domains from (domain)
to (common_third_party_id, domain) so a domain like google.com can be
associated with Google, Google Analytics, Google AdSense, etc.

Also fix Beamer domain (was hotjar.com, now getbeamer.com) and preserve
the original url.Parse error in pgconn DSN parsing.

Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
Émile Ré
2026-05-15 11:02:31 +04:00
parent 1a9cef7a9d
commit ed41b354b0
5 changed files with 8 additions and 7 deletions

View File

@@ -136,10 +136,9 @@ INSERT INTO common_third_party_domains (
@created_at,
@updated_at
)
ON CONFLICT (domain) DO UPDATE
ON CONFLICT (common_third_party_id, domain) DO UPDATE
SET
common_third_party_id = EXCLUDED.common_third_party_id,
updated_at = EXCLUDED.updated_at
updated_at = EXCLUDED.updated_at
RETURNING (xmax = 0) AS inserted
`