@@ -2232,7 +2232,10 @@ export async function upsertRow(
22322232 // the persisted type (e.g. a coerced `"123"` → `123` matches existing rows).
22332233 const targetValue = data . data [ targetColumnKey ]
22342234 if ( targetValue === undefined || targetValue === null ) {
2235- throw new Error ( `Upsert requires a value for the conflict target column "${ targetColumnKey } "` )
2235+ // Surface the display name, not the internal id — v1 callers pass a name.
2236+ const targetColumnName =
2237+ uniqueColumns . find ( ( c ) => getColumnId ( c ) === targetColumnKey ) ?. name ?? targetColumnKey
2238+ throw new Error ( `Upsert requires a value for the conflict target column "${ targetColumnName } "` )
22362239 }
22372240
22382241 // `data->` and `data->>` accept the JSON key as a parameterized text value;
@@ -2577,10 +2580,10 @@ function deriveExecClearsForDataPatch(
25772580 // that group's exec entry so the auto-fire reactor re-arms the cell.
25782581 // Also flags the cleared output column as dirty so transitive downstream
25792582 // groups see it.
2580- for ( const [ columnName , value ] of Object . entries ( dataPatch ) ) {
2583+ for ( const [ columnId , value ] of Object . entries ( dataPatch ) ) {
25812584 const cleared = value === null || value === undefined || value === ''
25822585 if ( ! cleared ) continue
2583- const col = schema . columns . find ( ( c ) => c . name === columnName )
2586+ const col = schema . columns . find ( ( c ) => getColumnId ( c ) === columnId )
25842587 if ( col ?. workflowGroupId ) groupsToClear . add ( col . workflowGroupId )
25852588 }
25862589
@@ -3923,12 +3926,12 @@ export async function addWorkflowGroup(
39233926 )
39243927 }
39253928
3926- // Assign stable ids to the new output columns (flag on) , then rewrite the
3927- // group's column refs from name → id so outputs/deps/inputMappings key on
3928- // ids — matching the row-data storage key and surviving future renames.
3929+ // Assign stable ids to the new output columns, then rewrite the group's
3930+ // column refs from name → id so outputs/deps/inputMappings key on ids —
3931+ // matching the row-data storage key and surviving future renames.
39293932 const takenIds = new Set ( collectColumnIds ( schema ) )
39303933 const outputColumns = data . outputColumns . map ( ( col ) => {
3931- if ( col . id || ! isTablesFractionalOrderingEnabled ) return col
3934+ if ( col . id ) return col
39323935 const id = generateColumnId ( takenIds )
39333936 takenIds . add ( id )
39343937 return { ...col , id }
0 commit comments