MigrationAction

zio.blocks.schema.migration.MigrationAction
See theMigrationAction companion trait

Attributes

Companion
trait
Source
MigrationAction.scala
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

final case class AddField(at: DynamicOptic, default: DynamicSchemaExpr) extends MigrationAction

Add a new field to a record with a default value. The field name is the last component of the at path.

Add a new field to a record with a default value. The field name is the last component of the at path.

Value parameters

at

The path to the field to add (must end with a Field node)

default

The default value expression for the new field

Attributes

Source
MigrationAction.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class ChangeFieldType(at: DynamicOptic, converter: DynamicSchemaExpr) extends MigrationAction

Change the type of a value at a path (primitive-to-primitive only).

Change the type of a value at a path (primitive-to-primitive only).

Value parameters

at

The path to the value

converter

The conversion expression

Attributes

Source
MigrationAction.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class DropField(at: DynamicOptic, defaultForReverse: DynamicSchemaExpr) extends MigrationAction

Drop a field from a record. The field name is the last component of the at path.

Drop a field from a record. The field name is the last component of the at path.

Value parameters

at

The path to the field to drop (must end with a Field node)

defaultForReverse

Default value expression to use when reversing (adding the field back)

Attributes

Source
MigrationAction.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class Irreversible(at: DynamicOptic, originalAction: String) extends MigrationAction

Sentinel action representing a non-invertible operation. Executing this action always fails with a descriptive error. This is returned by .reverse on actions that cannot be structurally reversed (e.g., TransformField, ChangeFieldType, OptionalizeField).

Sentinel action representing a non-invertible operation. Executing this action always fails with a descriptive error. This is returned by .reverse on actions that cannot be structurally reversed (e.g., TransformField, ChangeFieldType, OptionalizeField).

Value parameters

at

The path where the original action operated

originalAction

The name of the original non-invertible action

Attributes

Source
MigrationAction.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class MandateField(at: DynamicOptic, default: DynamicSchemaExpr) extends MigrationAction

Convert an optional field to a required field.

Convert an optional field to a required field.

Value parameters

at

The path to the optional value

default

The default value expression to use if the optional is None

Attributes

Source
MigrationAction.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class MigrateField(at: DynamicOptic, migration: DynamicMigration) extends MigrationAction

Apply an existing migration to a nested field. This is used for migration composition where a pre-built Migration is applied to a field.

Apply an existing migration to a nested field. This is used for migration composition where a pre-built Migration is applied to a field.

Value parameters

at

The path to the nested field

migration

The DynamicMigration to apply to the nested value

Attributes

Source
MigrationAction.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class OptionalizeField(at: DynamicOptic) extends MigrationAction

Convert a required field to an optional field.

Convert a required field to an optional field.

Value parameters

at

The path to the required value

Attributes

Source
MigrationAction.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class RenameCase(at: DynamicOptic, from: String, to: String) extends MigrationAction

Rename an enum case.

Rename an enum case.

Value parameters

at

The path to the enum value

from

The current case name

to

The new case name

Attributes

Source
MigrationAction.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class RenameField(at: DynamicOptic, to: String) extends MigrationAction

Rename a field in a record.

Rename a field in a record.

Value parameters

at

The path to the field to rename (must end with a Field node)

to

The new field name

Attributes

Source
MigrationAction.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class TransformCase(at: DynamicOptic, targetCaseName: String, actions: Chunk[MigrationAction]) extends MigrationAction

Transform the fields within an enum case.

Transform the fields within an enum case.

Value parameters

actions

The actions to apply to the case's record

at

The path to the enum value

Attributes

Source
MigrationAction.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class TransformElements(at: DynamicOptic, transform: DynamicSchemaExpr) extends MigrationAction

Replace each element in a collection with the result of evaluating the expression against that element.

Replace each element in a collection with the result of evaluating the expression against that element.

Value parameters

at

The path to the collection

transform

The expression whose result replaces each element

Attributes

Source
MigrationAction.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class TransformField(at: DynamicOptic, transform: DynamicSchemaExpr) extends MigrationAction

Transform a value at a path using a pure expression.

Transform a value at a path using a pure expression.

Value parameters

at

The path to the value to transform

transform

The transformation expression

Attributes

Source
MigrationAction.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class TransformKeys(at: DynamicOptic, transform: DynamicSchemaExpr) extends MigrationAction

Replace each key in a map with the result of evaluating the expression against that key.

Replace each key in a map with the result of evaluating the expression against that key.

Value parameters

at

The path to the map

transform

The expression whose result replaces each key

Attributes

Source
MigrationAction.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class TransformValues(at: DynamicOptic, transform: DynamicSchemaExpr) extends MigrationAction

Replace each value in a map with the result of evaluating the expression against that value.

Replace each value in a map with the result of evaluating the expression against that value.

Value parameters

at

The path to the map

transform

The expression whose result replaces each value

Attributes

Source
MigrationAction.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements.

The names of the product elements.

Attributes

Inherited from:
Mirror
Source
Mirror.scala
type MirroredLabel <: String

The name of the type.

The name of the type.

Attributes

Inherited from:
Mirror
Source
Mirror.scala