A Migrator[R, V] can migrate raw values of type R from older
versions to version V by applying a specific Migration[R] to it.
You can create instances of Migrator[R, V] by using
a small type-safe DSL consisting of two parts: the
from[R, V1] function will create a
Migrator[R, V1] and then you can use the
to[V](migration: Migration[R]) function to build
instances that can migrate multiple versions.
R
The type of raw data being migrated. In the JSON implementation this would be JsValue.
V
The "current" version of this Migrator, i.e. it can migrate values from V1 to this version or any version in between.
A
Migrator[R, V]
can migrate raw values of type R from older versions to versionV
by applying a specificMigration[R]
to it.You can create instances of
Migrator[R, V]
by using a small type-safe DSL consisting of two parts: thefrom[R, V1]
function will create aMigrator[R, V1]
and then you can use theto[V](migration: Migration[R])
function to build instances that can migrate multiple versions.The type of raw data being migrated. In the JSON implementation this would be
JsValue
.The "current" version of this Migrator, i.e. it can migrate values from V1 to this version or any version in between.
Using the json implementation: