SDK Guide
Migrations
Three versioned migration tables cover every breaking change in the spec. Apply them via migrateDocument and graphs on any prior version round-trip cleanly to current.
The three migration tables
Three versioned migration tables cover the full history of breaking changes in the spec. All three follow the same convention: the outer key is the spec version that introduced the migration; the value is an array of migration rules applied in order.
UPG_MIGRATIONS handles entity type renames and drops. UPG_PROPERTY_MIGRATIONS handles property renames and drops within a node's properties object. UPG_EDGE_MIGRATIONS handles edge type renames and drops. The runtime migrator (migrateDocument, migrateNode, migrateEdge) walks these tables in version order and applies each rule.
import {
UPG_MIGRATIONS,
UPG_PROPERTY_MIGRATIONS,
UPG_EDGE_MIGRATIONS,
migrateDocument,
} from '@unified-product-graph/core'
console.log(Object.keys(UPG_MIGRATIONS))
// → ['0.1.0', '0.2.0', '0.2.2', '0.2.5', '0.3.0', '0.4.0']
const migrated = migrateDocument(legacyDocument)What v0.4 changes
v0.4 migration rules include 14 MetricProperties field drops (deprecated since v0.2.2), 4 narrative-string property drops (use canonical edges instead), UPGAssessment canonicalisation of severity fields, and the Cadence retyping of ContentStrategyProperties.cadence and ContentCalendarProperties.publish_cadence. Graphs on v0.1–v0.3 round-trip cleanly through the migrator.