Watched my code wipe a client's test database at 11pm in Austin and now I back up everything
Last Tuesday I was at my kitchen table in Austin finishing up a small script for a client's staging site, and I ran it without reading the connection string twice. Turns out it was pointed at their test database, not the local one I thought, and my little delete query cleared about 4,000 rows of fake customer data they'd built up over 3 months. My stomach dropped when the terminal just said rows affected. I sat there for like 20 minutes just staring at the screen, then I called their dev lead and owned up to it right away. He was cool about it because it was test data, but he said I should always keep a dump before running anything destructive. So now I make a backup file first, every single time, even for stuff that feels safe, and I keep them in a folder named with the date so I know which one is fresh. Honestly it's a pain but it saved me again two weeks later when a different script went sideways. Has anyone else messed up a shared environment, and did it change how you work?