Structural schema + addField
type PersonV1 = { def name: String }
@schema case class PersonV2(name: String, age: Int)
implicit val v1Schema: Schema[PersonV1] = Schema.structural[PersonV1]
val v1ToV2 =
MigrationBuilder[PersonV1, PersonV2]
.addField(_.age, 0)
.build
Rename + composition
@schema case class PersonV3(fullName: String, age: Int)
val v2ToV3 =
MigrationBuilder[PersonV2, PersonV3]
.renameField(_.name, _.fullName)
.buildPartial
val v1ToV3 = v1ToV2 ++ v2ToV3
Selector grammar (paths)
MigrationBuilder[Old, New] .dropField(.address.street) .optionalizeField(.email) .buildPartial
Notable behavior
Tests
Notes / limitations
Review guide
Issues
Ahmed Elgharabawy
@Godzilla675
ZIO
@ZIO