mirror of
https://github.com/ModernRelay/omnigraph.git
synced 2026-07-12 03:12:11 +02:00
feat(compiler): plan pure enum widening as a supported ExtendEnum step
Adding variants to an enum property previously planned as an unsupported property-type change (OG-MF-106): enum values live inside PropType and the planner compared whole types. Special-case the one safe shape — same scalar/list/nullability and the desired value set a strict superset of the accepted one — into a new ExtendEnum step carrying the added values. Narrowing, variant renames, and enum<->String conversions still plan as OG-MF-106; a pure reorder was already a no-op (the schema IR sorts + dedups enum values). Planner matrix pinned in in-source tests (widening, reorder-as-no-change, narrowing, rename, widen+nullability-flip, enum<->String both ways); CLI plan rendering gains the ExtendEnum arm.
This commit is contained in:
parent
e211060119
commit
bc434fb577
2 changed files with 179 additions and 1 deletions
|
|
@ -566,6 +566,19 @@ pub(crate) fn render_schema_plan_step(step: &SchemaMigrationStep) -> String {
|
|||
schema_type_kind_label(*type_kind),
|
||||
type_name
|
||||
),
|
||||
SchemaMigrationStep::ExtendEnum {
|
||||
type_kind,
|
||||
type_name,
|
||||
property_name,
|
||||
added_values,
|
||||
} => format!(
|
||||
"extend enum '{}.{}' (+{}) on {} '{}'",
|
||||
type_name,
|
||||
property_name,
|
||||
added_values.join(", +"),
|
||||
schema_type_kind_label(*type_kind),
|
||||
type_name
|
||||
),
|
||||
SchemaMigrationStep::UpdateTypeMetadata {
|
||||
type_kind,
|
||||
name,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue