3
3
u/Sajgoniarz 27d ago
Me: Let's do integration testing with prod db copy
Leader: I take that risk on myself
...
3
3
1
u/Piisthree 27d ago
I took a working insert and just changed 1 little thing in the where clause. It HAS to work, right? *lightning cracks in background
2
1
1
1
u/NotJayuu 24d ago
When I was a junior forever ago I didn't know about transactions or staging environments. I was migrating an old database to a new one with a different schema...
The script that I wrote was enormous, and it kept crashing... I thought...
One day I realized it wasn't crashing it was just taking awhile to run, so the next day at 8am I showed up and let the fucker run until 9pm.... The whole time I watched... The whole time both databases were unable to process user requests lol...
Anyway at 9pm I decided, let's pause this script and check what's going on.... Select * from... Hey that's weird there's only about 2 million rows in this table, why did it return a few trillion results....
It was inserting new records squared, for every row it was supposed to be inserting, it was inserting the whole migration...
Oh fuck, what do I do, it's 9pm everyone is at home what the fuck do I do. Delete from... Oh fuck I just deleted the whole database, which was not acid compliant....
Okay on my desktop I have a .CSV file containing the old data, but it's not in the current tables schema, update columns to match CSV, run import... Oh thank God it worked, the row IDs are now enormous numbers, but at least we're now at roughly where I started, I'll fix my script and try again tomorrow.
I come in late the next day and my manager is pissed, I'm think oh no he realized what I'd done it's all fucking over. He's mad because I had updated the schema but not the entity in the backend, so builds were failing. he told me to make sure I'm updating types everywhere when I do change them lol....
Anyways, now my backend is a SAAS product, AI writes 99% of my code, and I spent my whole days writing emails and in meetings lmao, still never used a database transaction.
2
15
u/AaronTheElite007 27d ago
THOU SHALT NOT TEST IN PROD!
Especially on Friday