Liking cljdoc? Tell your friends :D

nicheware.platform.utilities.common.state.migration

Functions used when handling migration of state, where state is represented by a Clojure map.

The functions within the migration namespace can be categorised as:

Function groupFunctions
helper functionsmajor-version, minor-version, major-minor-version, could-upgrade-version
migration interfacemigrate-state

The migration functions assume the state map contains a version attribute

  { :version "1.0.1"}

Some functions require a migration map which for each current version defines the migrations that are defined to a later version.

  {"1.0"{:from-version "1.0"
           :to-version "1.1.0"
           :migration-fns [identity]}

   "1.1"{:from-version "1.1"
           :to-version "1.2.0"
           :migration-fns [add-effects/add-pattern-effects]}}

The :migration-fns attribute is a vector of functions that accept the old state map and return a newly migrated state map.

  Functions used when handling migration of state, where state is represented by a Clojure map.

  The functions within the migration namespace can be categorised as:

|Function group|Functions|
|---|---|
|helper functions| [[major-version]], [[minor-version]], [[major-minor-version]], [[could-upgrade-version]]|
|migration interface| [[migrate-state]]|

  The migration functions assume the state map contains a version attribute

```clojure
  { :version "1.0.1"}
```

 Some functions require a migration map which for each current version defines the migrations that are defined
 to a later version.

```clojure
  {"1.0"{:from-version "1.0"
           :to-version "1.1.0"
           :migration-fns [identity]}

   "1.1"{:from-version "1.1"
           :to-version "1.2.0"
           :migration-fns [add-effects/add-pattern-effects]}}
```

The ```:migration-fns``` attribute is a vector of functions that accept the old state map and return a newly migrated state map.
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close