Ever do something really dumb? I mean reeeeeeeeeeeeeally dumb? I did.
I'm working on a web site today, and it has a big ol' complex database with lots of tables. They hold thousands and thousands of bits of data (names, ages, email addresses, configuration settings, etc) About 1.5 million different bits of data actually. Now there's one really critical table that holds a whole bunch of info that ties to other tables. In fact, it ties into just about
all of the other tables and all the other tables tie into it. It's like the central table that stores all the stuff that alll the other parts of the program use to look up where to find the stuff
they need.
Well....Captain Brilliant (that's me) wanted to use this main table as a template to build a smaller, less complex table from. The main table has like 30 columns but I only needed the first 4 columns from it, so I copied the main table's structure (but not the data) to a new table name. Then I took the new table and dropped (removed) all but the 4 columns I needed.
Then I noticed that I was still working in the
main table.
Yep...it all went bye-bye. By the way, there's no "undo" in the mySQL database. When it's gone, it's
gone. For good. No gettin' it back, no way, no how. Gone as in "Elvis has left the building" gone. Gone as in a "puppy through a woodchipper" gone.
Yeah, the sweat popped out on my forehead like Niagra F*cking Falls. Did I mention that this was a live, active site with users running around all over the place doing stuff? Yeah, it was. Until I got there, anyway. lol
I had a backup file that was several days old (thank you, Lord), but a lot has happened in the last several days. I managed to get most of it back, then spent a couple of frantic hours bringing it back to more or less the state it was in before I cleverly screwed the livin' shit out of it. There are still a few minor things out of whack, but not too bad. Why, you'd *cough* hardly notice. lol
So I earned my "
F*ckTard Merit Badge" today. Now I think I'm gonna go lay down for a while.