zio.blocks.schema.migration.Migration
See theMigration companion object
A typed migration that transforms values from type A to type B.
Migration[A, B] provides a type-safe wrapper around DynamicMigration, handling the conversion between typed values and DynamicValue automatically.
The migration process:
- Convert input
A to DynamicValue using sourceSchema
- Apply the
dynamicMigration to transform the dynamic value
- Convert the result back to
B using targetSchema
The schemas can be any Schema[A] and Schema[B], including:
- Regular schemas derived from case classes/enums
- Structural schemas (JVM only) for compile-time-only types
This allows migrations between current runtime types and past structural versions without requiring old case classes to exist at runtime.
Type parameters
- A
-
The source type
- B
-
The target type
Value parameters
- dynamicMigration
-
The underlying untyped migration
- sourceSchema
-
Schema for the source type (can be structural or regular)
- targetSchema
-
Schema for the target type (can be structural or regular)
Attributes
- Companion
-
object
- Source
-
Migration.scala
- Graph
-
- Supertypes
-
trait Product
trait Equals
trait Matchable
class Any
Show all
Members list
Compose this migration with another, applying this migration first, then the other.
Compose this migration with another, applying this migration first, then the other.
Value parameters
- that
-
The migration to apply after this one
Attributes
- Returns
-
A new migration that applies both in sequence
- Source
-
Migration.scala
Get the list of actions in this migration.
Get the list of actions in this migration.
Attributes
- Source
-
Migration.scala
Apply this migration to transform a value from type A to type B.
Apply this migration to transform a value from type A to type B.
Value parameters
- value
-
The input value to migrate
Attributes
- Returns
-
Either a SchemaError or the migrated value
- Source
-
Migration.scala
Returns true if this migration has no actions (identity migration).
Returns true if this migration has no actions (identity migration).
Attributes
- Source
-
Migration.scala
Returns the structural reverse of this migration.
Returns the structural reverse of this migration.
Note: Runtime execution of the reverse migration is best-effort. It may fail if information was lost during the forward migration.
Attributes
- Source
-
Migration.scala
Returns the number of actions in this migration.
Returns the number of actions in this migration.
Attributes
- Source
-
Migration.scala
An iterator over the names of all the elements of this product.
An iterator over the names of all the elements of this product.
Attributes
- Inherited from:
-
Product
- Source
-
Product.scala
An iterator over all the elements of this product.
An iterator over all the elements of this product.
Attributes
- Returns
-
in the default implementation, an Iterator[Any]
- Inherited from:
-
Product
- Source
-
Product.scala