You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cowork-bot: fix FK column detection in flatten mode
When flattening nested arrays, the FK column in the child table must match
the parent table's primary key column name and type. Previously the code
preferred 'name' over explicit ID fields like 'user_id' or 'users_id',
causing a type mismatch (TEXT FK vs INTEGER PK).
New priority order for parent reference key:
1. 'id' (generic primary key)
2. '{parent_table}_id' (table-specific, e.g., 'users_id')
3. Any key ending in '_id' found in parent objects (e.g., 'user_id')
4. 'name' (fallback only when no ID-like field exists)
Added 12 regression tests covering all three dialects (Postgres, MySQL, SQLite).
0 commit comments