Fixes for HistoryUUID
This commit is contained in:
parent
be7f5dbf30
commit
3e8d5b6d9a
7 changed files with 176 additions and 18 deletions
6
node.go
6
node.go
|
|
@ -44,6 +44,7 @@ type Node struct {
|
|||
UUID string
|
||||
UserID int `db:"user_id"`
|
||||
ParentUUID string `db:"parent_uuid"`
|
||||
HistoryUUID string `db:"history_uuid"`
|
||||
Name string
|
||||
Created time.Time
|
||||
Updated time.Time
|
||||
|
|
@ -122,7 +123,7 @@ func Nodes(userID, offset int, synced uint64, clientUUID string) (nodes []Node,
|
|||
rows, err = db.Queryx(`
|
||||
SELECT
|
||||
uuid,
|
||||
COALESCE(parent_uuid, '') AS parent_uuid,
|
||||
COALESCE(parent_uuid, '00000000-0000-0000-0000-000000000000'::uuid) AS parent_uuid,
|
||||
name,
|
||||
created,
|
||||
updated,
|
||||
|
|
@ -137,7 +138,7 @@ func Nodes(userID, offset int, synced uint64, clientUUID string) (nodes []Node,
|
|||
public.node
|
||||
WHERE
|
||||
user_id = $1 AND
|
||||
client != $5 AND
|
||||
client != $5::uuid AND
|
||||
NOT history AND (
|
||||
created_seq > $4 OR
|
||||
updated_seq > $4 OR
|
||||
|
|
@ -251,6 +252,7 @@ func RetrieveNodeHistory(userID int, nodeUUID string, offset int) (nodes []Node,
|
|||
rows, err = db.Queryx(`
|
||||
SELECT
|
||||
uuid,
|
||||
history_uuid,
|
||||
user_id,
|
||||
name,
|
||||
created,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue