KamoCRM

Record that Java field order does not control DDL key order

Docskamo-shared-library
Shipped
25 ஆகஸ்ட், 2026 அன்று 2:26 PM UTC
Author
Kamo
Commit
47c8dad

The composite-key assertion passed while ddl-auto actually built PRIMARY KEY (logical_id, resource_type, tenant_id) — Hibernate emits @EmbeddedId columns ALPHABETICALLY, not in declaration order. On Yugabyte the first PK column picks the shard, so it was leading with a UUID and scattering every practice's chart across every tablet: the exact opposite of what the composite key is for. Same lesson as the @EntityGraph incident on /leads. A mapping can compile, pass its tests, and still generate the wrong SQL; only executing it tells you. The stored order is corrected and verified against pg_constraint by KamoInitializer's ****************

All changes

Like what you see shipping?

All of it arrives in your workspace on its own. Start on the free plan and read this page again in a month.

Start Free ForeverView Pricing