Data motion changes the shape of existing data so that it conforms to a new database schema. Unlike schema changes, these transformations depend on domain-specific rules because data is context-dependent. section 10.1
Explicit migrations handle data motion more reliably than state-based comparison tools. State-based delivery makes schema state explicit and migrations implicit; migration-based delivery makes each transition explicit. section 10.1 section 10.7
Splitting a name column
Replacing Name with FirstName and LastName requires more than dropping one column and creating two others. A migration must also split every existing name according to appropriate domain rules. section 10.1
Use these rules when database changes must preserve existing data:
- Prefer explicit migrations after the application reaches production, when existing data cannot simply be discarded. section 10.1
- Apply every schema modification, including reference-data changes, through migrations. section 10.7
Figure 10.2. The migration-based approach to database delivery emphasizes the use of explicit migrations that transition the database from one version to another.
Shows explicit migrations transitioning a database from one version to another, the delivery mechanism used to manage data motion. section 10.1
