Add and backfill accounts.date_created

FeatureInitializerService
Shipped
August 10, 2026 at 6:29 PM UTC
Author
Kamo
Commit
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.

All changes

Like what you see shipping?

Every one of these updates lands in your workspace automatically. Start free and watch it grow week after week.

Start Free ForeverView Pricing