feat(tables): stable column ids for metadata-only rename#4898
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryHigh Risk Overview A new The workspace grid is id-native end-to-end ( Reviewed by Cursor Bugbot for commit d91ef6c. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryThis PR replaces name-keyed row storage with stable
Confidence Score: 5/5Safe to merge — the stable-id system is consistent across all column-creation, storage, and translation paths, and the backfill migration is idempotent. All column-creation paths unconditionally assign stable ids; boundary translation (name↔id) is applied consistently at the v1 API, mothership tool, and CSV edges; the migration correctly grandfathers legacy rows by setting id=name; apps/sim/lib/table/service.ts — the two Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["v1 API / Mothership / CSV\n(column names on the wire)"] -->|rowDataNameToId\nfilterNamesToIds\nsortNamesToIds| B["Service Layer\n(row data keyed by col_id)"]
B -->|rowDataIdToName\nbuildNameById| A
B --> C["user_table_rows.data\nJSONB keyed by col_id"]
B --> D["user_table_definitions.schema\ncolumns[].id = col_uuid"]
B --> E["user_table_definitions.metadata\ncolumnOrder / widths / pinned\n(all keyed by col_id)"]
F["Internal Grid / Hooks\n(id-native via getColumnId)"] -->|direct id keys| B
G["Migration 0229\nid = name for legacy cols\nidempotent"] --> D
subgraph col_keys["column-keys.ts chokepoint"]
H["getColumnId(col)\ncol.id ?? col.name"]
I["generateColumnId()\ncol_UUID"]
J["columnMatchesRef(col, ref)\nid-exact OR name-ci"]
end
B --> col_keys
Reviews (10): Last reviewed commit: "fix(tables): translate id→name in CSV/JS..." | Re-trigger Greptile |
…me in upsert error, un-gate group output ids
|
@greptile review |
|
@greptile review |
…on-check plumbing
|
@greptile review |
…stic delete cache
|
@greptile review |
…rename-column # Conflicts: # packages/db/migrations/meta/0227_snapshot.json # packages/db/migrations/meta/_journal.json
|
@greptile review |
…ips; biome-format 0228 snapshot
|
@greptile review |
…rename-column # Conflicts: # packages/db/migrations/meta/0228_snapshot.json # packages/db/migrations/meta/_journal.json
|
@greptile review |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 98c883c. Configure here.
|
@greptile review |
|
@greptile review |
|
@greptile review |

Summary
id; row data, metadata (widths/order/pins), workflow-group refs, and filter/sort key by id instead of by namegetColumnIdchokepoint; public v1 API + mothership tool + CSV translate name↔id at the boundary0227_backfill_column_idsstampsid = nameonto existing columns (metadata-only, idempotent); the legacy row-rewrite rename / sync-strip delete paths are removedType of Change
Testing
UPDATE 101, re-runUPDATE 0)bun run lint:checkandbun run check:api-validation:strictpasscolumn-keystests)Checklist