Legacy schema traps · Keys and relations
Why does one table hold all the codes in my ERP?
Because one generic code table holds many lists, told apart only by a type column. A lookup on the code alone mixes up payment terms, regions and order types; every lookup needs the type as well.
What it looks likeIllustrative
CODES(TYPE, CODE, TEXT), where TYPE='PT' is payment terms and TYPE='RG' is regions.
All table and column names are invented.
Why reports and AI agents get it wrong
It joins on CODE without TYPE and shows the region name as the payment term.
A first check you can run
A table with a short type column, a code column and a text column, with many distinct types.
Read-only and on the catalogue or aggregates: it looks at structure and value counts, not at individual records.
How Janus Works handles it
Every lookup carries its type; the tool fails rather than guessing.
Every number verified against your own screens. Deviations shown, never hidden.