3 ms·
Two more problems identified solely from the screenshot: * you have two competing subscription id columns. * a uuid is not a string, it is a 128 bit integer.
by AndyKelley 2y ago
Two more problems identified solely from the screenshot:
* you have two competing subscription id columns.
* a uuid is not a string, it is a 128 bit integer. If your database limits to 64 bit integers then use a 64 bit integer for the id instead of a string, or use an array of 128 bytes.
- spixy 2y agouuid is a 128 bit integer but at the same time a string Many ORMs represent UUID as a string.
- SamBam 2y agoGood catch, I agree that subscription_id looks hallucinated.
- beala 2y agoThe StripeCustomer table has the same issue. There's both an `id` column and a unique `customerId` column. Presumably the `id` column is useless and could be removed. Also, is there a way to set up foreign key constraints on `userId` with this ORM? That seems like another oversight.
- cuppypastexprt 2y agoIn that blog they say they have now added very robust unit and integration tests, so I don't think this is an issue.
- cube00 2y agoI'd be concerned said "robust" tests were also lifted from ChatGPT.
- Kesty 2y agoThe conclusion of the blog are not great either. Sure you should have tests, sure you shouldn't copy paste code you don't understand and you shouldn't push directly to production. But, regardless of all that, the main issue of all this incident is not the rookie mistake itself, is how they didn't have logs or alerts and it took them 5 days of customer complaining to find out they had "duplication errors" in the db. That's the thing that should have been fixed first and extensivly mentioned in the post-mortem
- throwawayffffas 2y ago> you have two competing subscription id columns. That's kind of rational, id is their own internal id. subscription_id is the id on stripe. A better name would be stripe_id.