Unistore : Ensure Watch works in HA mode (#94120)
* Revert "Revert "Unistore : Ensure Watch works in HA mode." (#94097)"
This reverts commit 7c3fc2f261.
* make previous_resource_version nullable
* handle nil case
This commit is contained in:
@@ -6,6 +6,7 @@ INSERT INTO {{ .Ident "resource_history" }}
|
||||
{{ .Ident "namespace" }},
|
||||
{{ .Ident "name" }},
|
||||
|
||||
{{ .Ident "previous_resource_version"}},
|
||||
{{ .Ident "value" }},
|
||||
{{ .Ident "action" }}
|
||||
)
|
||||
@@ -17,6 +18,7 @@ INSERT INTO {{ .Ident "resource_history" }}
|
||||
{{ .Arg .WriteEvent.Key.Namespace }},
|
||||
{{ .Arg .WriteEvent.Key.Name }},
|
||||
|
||||
{{ .Arg .WriteEvent.PreviousRV }},
|
||||
{{ .Arg .WriteEvent.Value }},
|
||||
{{ .Arg .WriteEvent.Type }}
|
||||
)
|
||||
|
||||
@@ -5,7 +5,8 @@ SELECT
|
||||
{{ .Ident "resource" | .Into .Response.Key.Resource }},
|
||||
{{ .Ident "name" | .Into .Response.Key.Name }},
|
||||
{{ .Ident "value" | .Into .Response.Value }},
|
||||
{{ .Ident "action" | .Into .Response.Action }}
|
||||
{{ .Ident "action" | .Into .Response.Action }},
|
||||
{{ .Ident "previous_resource_version" | .Into .Response.PreviousRV }}
|
||||
|
||||
FROM {{ .Ident "resource_history" }}
|
||||
WHERE 1 = 1
|
||||
|
||||
@@ -7,6 +7,7 @@ INSERT INTO {{ .Ident "resource" }}
|
||||
{{ .Ident "namespace" }},
|
||||
{{ .Ident "name" }},
|
||||
|
||||
{{ .Ident "previous_resource_version" }},
|
||||
{{ .Ident "value" }},
|
||||
{{ .Ident "action" }}
|
||||
)
|
||||
@@ -17,6 +18,7 @@ INSERT INTO {{ .Ident "resource" }}
|
||||
{{ .Arg .WriteEvent.Key.Namespace }},
|
||||
{{ .Arg .WriteEvent.Key.Name }},
|
||||
|
||||
{{ .Arg .WriteEvent.PreviousRV }},
|
||||
{{ .Arg .WriteEvent.Value }},
|
||||
{{ .Arg .WriteEvent.Type }}
|
||||
)
|
||||
|
||||
@@ -8,6 +8,6 @@ INSERT INTO {{ .Ident "resource_version" }}
|
||||
VALUES (
|
||||
{{ .Arg .Group }},
|
||||
{{ .Arg .Resource }},
|
||||
1
|
||||
2
|
||||
)
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user