sqldb+graph/db: fix UpsertNode bug
Account for the last_update field being null.
This commit is contained in:
3 files changed
+5
-14
No files matched your search
@@ -542,7 +542,8 @@ ON CONFLICT (pub_key, version)
|
||||
last_update = EXCLUDED.last_update,
|
||||
color = EXCLUDED.color,
|
||||
signature = EXCLUDED.signature
|
||||
WHERE EXCLUDED.last_update > nodes.last_update
|
||||
WHERE nodes.last_update IS NULL
|
||||
OR EXCLUDED.last_update > nodes.last_update
|
||||
RETURNING id
|
||||
`
|
||||
|
||||
|
||||
@@ -17,7 +17,8 @@ ON CONFLICT (pub_key, version)
|
||||
last_update = EXCLUDED.last_update,
|
||||
color = EXCLUDED.color,
|
||||
signature = EXCLUDED.signature
|
||||
WHERE EXCLUDED.last_update > nodes.last_update
|
||||
WHERE nodes.last_update IS NULL
|
||||
OR EXCLUDED.last_update > nodes.last_update
|
||||
RETURNING id;
|
||||
|
||||
-- name: GetNodeByPubKey :one
|
||||
|
||||
Reference in new issue
Block a user