This PR implements a pure, algebraic migration system for ZIO Schema that represents structural transformations between schema versions as first-class, serializable data.
AtField, AtCase, AtElements, enabling migrations like _.address.street -> _.address.streetNameimport zio.blocks.schema.migration._
case class PersonV1(firstName: String, lastName: String)
case class PersonV2(fullName: String, age: Int)
val migration = MigrationBuilder[PersonV1, PersonV2]
.joinFields(Vector("firstName", "lastName"), "fullName",
ResolvedExpr.concatWith(" ")(
ResolvedExpr.field("firstName"),
ResolvedExpr.field("lastName")
))
.addFieldInt("age", 0)
.build
// Nested migrations
val nestedMigration = MigrationBuilder[WithAddressV1, WithAddressV2]
.atField("address")(
_.renameField("street", "streetName")
.addFieldString("zipCode", "00000")
)
.build
/attempt #519 /claim #519
Yuvraj Angad Singh
@yuvrajangadsingh
ZIO
@ZIO