KamoCRM

Add and backfill accounts.date_created

FeatureInitializerService
Ya
10 Agosti 2026, 18:29 UTC
Mwandishi
Kamo
Ahadi ya
ffd3e64

Hibernate cannot add this one itself: ddl-auto emits it NOT NULL, which CockroachDB refuses on a table that already has rows. So it is added nullable here, backfilled, then constrained. The backfill decodes each account's unique_rowid() primary key, which packs its insert time into the high bits — that recovers each account's real creation time instead of flattening all 23 existing rows onto the migration timestamp, which would have made the list's ascending date order meaningless for exactly the accounts that have been around longest. That layout is a CockroachDB implementation detail, so the decoder is first checked against members, which have both a unique_rowid() key and a recorded creation date; it is only applied if it reproduces theirs. On the production run it matched 62 of 62 and recovered all 23 accounts, none falling to the fallback. Order 0, ahead of every other runner: the entity maps the column as soon as this build starts, so any runner that loads an Account emits it in its SELECT. Ordered late, this one never ran at all — LeadContactPointSeedRunner died on "column a1_0.date_created does not exist" and took the run down with it.

Mabadiliko yote

Je, unaona nini kuhusu usafiri?

Kila kitu kinaingia kwenye tovuti yako mwenyewe. Anza kwenye mpango wa bure na usome ukurasa huu tena katika mwezi mmoja.

Kuwa Huru MileleMtazamo wa bei