mirror of
https://github.com/ilyakooo0/urbit.git
synced 2025-01-07 15:38:45 +03:00
graph-store: on overwrite, archive existing graph
This commit is contained in:
parent
bf9d6cfe44
commit
fc189a7c13
@ -257,11 +257,17 @@
|
|||||||
?& !(~(has by archive) resource)
|
?& !(~(has by archive) resource)
|
||||||
!(~(has by graphs) resource)
|
!(~(has by graphs) resource)
|
||||||
== ==
|
== ==
|
||||||
|
=/ old-graph=(unit marked-graph:store)
|
||||||
|
(~(get by graphs) resource)
|
||||||
?> (validate-graph graph mark)
|
?> (validate-graph graph mark)
|
||||||
:_ %_ state
|
:_ %_ state
|
||||||
graphs (~(put by graphs) resource [graph mark])
|
graphs (~(put by graphs) resource [graph mark])
|
||||||
update-logs (~(put by update-logs) resource (gas:orm-log ~ ~))
|
update-logs (~(put by update-logs) resource (gas:orm-log ~ ~))
|
||||||
archive (~(del by archive) resource)
|
archive
|
||||||
|
?~ old-graph
|
||||||
|
(~(del by archive) resource)
|
||||||
|
(~(put by archive) resource u.old-graph)
|
||||||
|
::
|
||||||
validators
|
validators
|
||||||
?~ mark validators
|
?~ mark validators
|
||||||
(~(put in validators) u.mark)
|
(~(put in validators) u.mark)
|
||||||
|
@ -37,8 +37,10 @@
|
|||||||
::
|
::
|
||||||
?. =(our.bowl entity.rid.action)
|
?. =(our.bowl entity.rid.action)
|
||||||
(strand-fail:strandio %bad-request ~)
|
(strand-fail:strandio %bad-request ~)
|
||||||
|
=/ overwrite=?
|
||||||
|
?=(%policy -.associated.action)
|
||||||
=/ =update:graph
|
=/ =update:graph
|
||||||
[%0 now.bowl %add-graph rid.action *graph:graph mark.action %.n]
|
[%0 now.bowl %add-graph rid.action *graph:graph mark.action overwrite]
|
||||||
;< ~ bind:m
|
;< ~ bind:m
|
||||||
(poke-our %graph-store graph-update+!>(update))
|
(poke-our %graph-store graph-update+!>(update))
|
||||||
;< ~ bind:m
|
;< ~ bind:m
|
||||||
|
Loading…
Reference in New Issue
Block a user