mirror of
https://github.com/tloncorp/landscape.git
synced 2024-12-01 10:55:45 +03:00
settings,storage: add migration code
This commit is contained in:
parent
c61f1fb30f
commit
7b839397bd
@ -18,13 +18,23 @@
|
||||
%+ verb |
|
||||
^- agent:gall
|
||||
=<
|
||||
|_ bol=bowl:gall
|
||||
|_ =bowl:gall
|
||||
+* this .
|
||||
do ~(. +> bol)
|
||||
def ~(. (default-agent this %|) bol)
|
||||
io ~(. agentio bol)
|
||||
do ~(. +> bowl)
|
||||
def ~(. (default-agent this %|) bowl)
|
||||
io ~(. agentio bowl)
|
||||
::
|
||||
++ on-init on-init:def
|
||||
++ on-init
|
||||
:: XX: deprecated; migration code
|
||||
^- (quip card _this)
|
||||
:_ this
|
||||
:~ :* %pass
|
||||
/migrate
|
||||
%agent
|
||||
[our dap]:bowl
|
||||
%poke
|
||||
noun+!>(%migrate)
|
||||
== ==
|
||||
::
|
||||
++ on-save !>(state)
|
||||
::
|
||||
@ -42,23 +52,36 @@
|
||||
++ on-poke
|
||||
|= [mar=mark vas=vase]
|
||||
^- (quip card _this)
|
||||
?> (team:title our.bol src.bol)
|
||||
?. ?=(%settings-event mar)
|
||||
(on-poke:def mar vas)
|
||||
=/ evt=event !<(event vas)
|
||||
?> (team:title our.bowl src.bowl)
|
||||
=^ cards state
|
||||
?+ mar (on-poke:def mar vas)
|
||||
%settings-event
|
||||
=/ evt=event !<(event vas)
|
||||
?- -.evt
|
||||
%put-bucket (put-bucket:do [desk key bucket]:evt)
|
||||
%del-bucket (del-bucket:do [desk key]:evt)
|
||||
%put-entry (put-entry:do [desk buc key val]:evt)
|
||||
%del-entry (del-entry:do [desk buc key]:evt)
|
||||
==
|
||||
::
|
||||
:: XX: deprecated; migration code
|
||||
%noun
|
||||
?> ?=(%migrate !<(%migrate vas))
|
||||
=/ bas /(scot %p our.bowl)/settings-store/(scot %da now.bowl)
|
||||
:- ~
|
||||
?. .^(? %gu bas)
|
||||
state
|
||||
=/ ful .^(data %gx (weld bas /all/noun))
|
||||
?+ -.ful (on-poke:def mar vas)
|
||||
%all state(settings +.ful)
|
||||
==
|
||||
==
|
||||
[cards this]
|
||||
::
|
||||
++ on-watch
|
||||
|= pax=path
|
||||
^- (quip card _this)
|
||||
?> (team:title our.bol src.bol)
|
||||
?> (team:title our.bowl src.bowl)
|
||||
?+ pax (on-watch:def pax)
|
||||
[%all ~]
|
||||
[~ this]
|
||||
|
@ -27,7 +27,17 @@
|
||||
+* this .
|
||||
def ~(. (default-agent this %|) bowl)
|
||||
::
|
||||
++ on-init on-init:def
|
||||
++ on-init
|
||||
:: XX: deprecated; migration code
|
||||
^- (quip card _this)
|
||||
:_ this
|
||||
:~ :* %pass
|
||||
/migrate
|
||||
%agent
|
||||
[our dap]:bowl
|
||||
%poke
|
||||
noun+!>(%migrate)
|
||||
== ==
|
||||
++ on-save !>(state)
|
||||
++ on-load
|
||||
|= =vase
|
||||
@ -61,7 +71,29 @@
|
||||
?> (team:title our.bowl src.bowl)
|
||||
=^ cards state
|
||||
?+ mark (on-poke:def mark vase)
|
||||
%storage-action (poke-action !<(action vase))
|
||||
%storage-action
|
||||
(poke-action !<(action vase))
|
||||
::
|
||||
:: XX: deprecated; migration code
|
||||
%noun
|
||||
?> ?=(%migrate !<(%migrate vase))
|
||||
=/ bas /(scot %p our.bowl)/s3-store/(scot %da now.bowl)
|
||||
:- ~
|
||||
?. .^(? %gu bas)
|
||||
state
|
||||
=:
|
||||
credentials
|
||||
=/ ful .^(update %gx (weld bas /credentials/noun))
|
||||
?+ -.ful (on-poke:def mark vase)
|
||||
%credentials +.ful
|
||||
==
|
||||
::
|
||||
configuration
|
||||
=/ ful .^(update %gx (weld bas /configuration/noun))
|
||||
?+ -.ful (on-poke:def mark vase)
|
||||
%configuration +.ful
|
||||
== ==
|
||||
state
|
||||
==
|
||||
[cards this]
|
||||
::
|
||||
|
Loading…
Reference in New Issue
Block a user