3 ms·
Your first point about foreign keys was the first contract I ever did. Someone built a billing system in perl+mysql for an ecommerce site. When prices changed s
by gryf 4y ago
Your first point about foreign keys was the first contract I ever did. Someone built a billing system in perl+mysql for an ecommerce site. When prices changed so did historical invoices. I was hired to work this out because the existing developers couldn't. They only realised realised that something was wrong after a customer sued them after being paid the wrong amount in a refund.
I rewrote the entire system to snapshot the committed values at the time of purchase and fixing all the old invoices from database backups.
- robertlagrant 4y agoThe way you'd assume they'd do it if they wanted relational values would be to never be able to edit prices, only create new ones.
- withinboredom 4y ago> never be able to edit prices I can't think of any database that makes a row strictly immutable, as in carved onto the platter immutable. People will find ways to undo any soft-guards you put into place, all in the name of being helpful.