Stop the pay-group entity sitting on a legacy table

Fixkamo-shared-library
Shipped
August 11, 2026 at 6:17 AM UTC
Author
Kamo
Commit
d490467

BillingGroup was mapped to billing_groups. That table already existed — one of a seven-table subsystem (billing_group_members, _subscriptions, _licenses, _invoices, _payment_methods, _configs) with no Java code left mapping it, but with four real rows in it and a different shape entirely: there the group IS the payer, carrying its own stripe_customer_id and billing_email. The audit behind this work reported "no billing GROUP concept". That was wrong; it read the code, and this subsystem exists only in the schema. Pointing an entity at it had two consequences. Reading groups failed on a missing is_approved, because neither CockroachDB nor YugabyteDB will add a NOT NULL column without a default to a non-empty table, so ddl-auto added the nullable columns and skipped the rest. And those four legacy rows were one successful query away from being served as somebody else's billing groups. The entity now owns billing_pay_groups, created explicitly by a migration rather than by ddl-auto — which is what produced a half-built table in the first place. The columns added to the legacy table are dropped again, returning it to the shape it had; its rows are never touched. Adopting the legacy subsystem instead of this one is a defensible future call, but it is a migration, not a rename.

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