diff options
| author | Dan Goodliffe <dan.goodliffe@octal.co.uk> | 2026-06-29 09:33:57 +0100 |
|---|---|---|
| committer | Dan Goodliffe <dan.goodliffe@octal.co.uk> | 2026-06-29 09:33:57 +0100 |
| commit | 26eda4262fa99888e254e9c19b40c04b2a29a75c (patch) | |
| tree | c1f2fdeb8d36d9e663b5a2f25842b7b59574e822 /src/sql/hostUpsert.sql | |
| parent | ad2a2ff05af8df1ba552d906e377afa345a449a7 (diff) | |
| download | webstat-26eda4262fa99888e254e9c19b40c04b2a29a75c.tar.bz2 webstat-26eda4262fa99888e254e9c19b40c04b2a29a75c.tar.xz webstat-26eda4262fa99888e254e9c19b40c04b2a29a75c.zip | |
Fix uniqueness of entities
Should be unique for value and type, they're not just strings, they can
be different things with the same value... Albeit rarely.
Diffstat (limited to 'src/sql/hostUpsert.sql')
| -rw-r--r-- | src/sql/hostUpsert.sql | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sql/hostUpsert.sql b/src/sql/hostUpsert.sql index d5ee11d..5c8be1e 100644 --- a/src/sql/hostUpsert.sql +++ b/src/sql/hostUpsert.sql @@ -1,7 +1,7 @@ INSERT INTO entities(type, value, detail) VALUES ('host', $1, jsonb_build_object('sysname', $2::text, 'release', $3::text, 'version', $4::text, 'machine', $5::text, 'domainname', $6::text)) -ON CONFLICT (md5(value)) +ON CONFLICT (md5(value), type) DO UPDATE SET detail = jsonb_build_object('sysname', $2::text, 'release', $3::text, 'version', $4::text, 'machine', $5::text, 'domainname', $6::text) |
