mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-12 15:01:38 +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 graphs) resource)
|
||||
== ==
|
||||
=/ old-graph=(unit marked-graph:store)
|
||||
(~(get by graphs) resource)
|
||||
?> (validate-graph graph mark)
|
||||
:_ %_ state
|
||||
graphs (~(put by graphs) resource [graph mark])
|
||||
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
|
||||
?~ mark validators
|
||||
(~(put in validators) u.mark)
|
||||
|
@ -37,8 +37,10 @@
|
||||
::
|
||||
?. =(our.bowl entity.rid.action)
|
||||
(strand-fail:strandio %bad-request ~)
|
||||
=/ overwrite=?
|
||||
?=(%policy -.associated.action)
|
||||
=/ =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
|
||||
(poke-our %graph-store graph-update+!>(update))
|
||||
;< ~ bind:m
|
||||
|
Loading…
Reference in New Issue
Block a user