Just experienced a perfectly executed forehead-slapping moment.
I've been working on some fairly confusing code all day, having to manually update a database in lieu of a backend system being built at the same time. Reaching the end of the working day, the caffeine's wearing off and I'm starting to lose focus. So, I knock up a quick database schema update to reflect the latest changes and at the same time, as always, exporting the complete structure-only schema for our main database to CVS. A simple few clicks to update the live DB with the updates script, and I should be done and on the home strait.
For no particular reason I glance across the office to ask a colleague if the live DB was being regularly updated while flicking through the 'Import' options on phpMyAdmin I'm so familiar with. Don't know why, just a thought that popped into my head.
Yeah, so there I was selecting the full schema script for import rather than the script for the minor update. The script that contains a whole slew of DROP TABLE, followed by CREATE TABLE statements, rather than a few harmless ALTER TABLEs. Just as I refocus my eyes on the screen I click the 'Go' button, and one of those beautiful moments occured where the world slows down and you can almost hear the pops and clicks as the whole database disappears on a merry jaunt into the digital ether.
Whoops.
Fortunately the answer to my question was 'yes', and a few minutes later the DB was back up and running with just a little bit of non-essential data loss and the latest changes, this time, successfully applied. Oh, and the schema no longer contains any DROP TABLEs
. I think it's one of my finest moments so far.
So, what's the stupidest thing you've done in those moments when you really should have been paying more attention?
I've been working on some fairly confusing code all day, having to manually update a database in lieu of a backend system being built at the same time. Reaching the end of the working day, the caffeine's wearing off and I'm starting to lose focus. So, I knock up a quick database schema update to reflect the latest changes and at the same time, as always, exporting the complete structure-only schema for our main database to CVS. A simple few clicks to update the live DB with the updates script, and I should be done and on the home strait.
For no particular reason I glance across the office to ask a colleague if the live DB was being regularly updated while flicking through the 'Import' options on phpMyAdmin I'm so familiar with. Don't know why, just a thought that popped into my head.
Yeah, so there I was selecting the full schema script for import rather than the script for the minor update. The script that contains a whole slew of DROP TABLE, followed by CREATE TABLE statements, rather than a few harmless ALTER TABLEs. Just as I refocus my eyes on the screen I click the 'Go' button, and one of those beautiful moments occured where the world slows down and you can almost hear the pops and clicks as the whole database disappears on a merry jaunt into the digital ether.
Whoops.
Fortunately the answer to my question was 'yes', and a few minutes later the DB was back up and running with just a little bit of non-essential data loss and the latest changes, this time, successfully applied. Oh, and the schema no longer contains any DROP TABLEs

So, what's the stupidest thing you've done in those moments when you really should have been paying more attention?