I Accidentally Deleted All Our Data
taylor.fausak.me
I Accidentally Deleted All Our Data
1–10 of 78 posts
Re: I Accidentally Deleted All Our Data
#2Re: I Accidentally Deleted All Our Data
#3The worst was executing "DELETE FROM " instead of "DELETE FROM where userid='X' on a production server.
Re: I Accidentally Deleted All Our Data
#4I've done this a few times in my career. I'm smart enough now to always backup before I make any potential mistakes and test everything on a staging server. The worst was executing "DELETE FROM " instead of "DELETE FROM where userid='X' on a production server.
I realized what I did the instant I hit enter, and all the blood drained from my face.
Thank god for backups.
Re: I Accidentally Deleted All Our Data
#5Re: I Accidentally Deleted All Our Data
#6Update set =
instead of
Update set = where
The code was executed on development server(thankfully) and it created a big mess. Full day work of 5 guys was lost. Project Manager banned her from developing any critical program and told her she will only write abap/4 reports from then onwards.
Re: I Accidentally Deleted All Our Data
#7But besides the obvious takeaway of always having recent, tested backups, I think it's also important to get out of the habit of ever using a REPL (or SSH for that matter) to connect to production servers. Write a one-off script, document when and why you made it, check it into your VCS of choice, and run it against the target server(s). Of course within the script itself feel free to make any connections you need; my point is to never do it "manually" from the command-line. This also prepares you for when you move past having a single live server for web or db. If you're in Python-land, Fabric is the go-to tool these days for automating this.
Re: I Accidentally Deleted All Our Data
#8Although direct database update isn't recommended in SAP, still for some strange reasons it was needed in one of the projects to modify a wrong entry done by functional consultant. One of my fellow programmer was assigned this task and this is what she did - Update set = instead of Update set = where The code was executed on development server(thankfully) and it created a big mess. Full day work of 5 guys was lost. P…
Re: I Accidentally Deleted All Our Data
#9Happy to hear that you had backups and not too much data was lost because you caught it quickly. But besides the obvious takeaway of always having recent, tested backups, I think it's also important to get out of the habit of ever using a REPL (or SSH for that matter) to connect to production servers. Write a one-off script, document when and why you made it, check it into your VCS of choice, and run it against the t…
$ python manage.py shell
In this instance, I didn't even consider that what I was doing could be catastrophic. But you're right, you want to avoid doing things manually. In the future, I'll track all the scripts I run. And thanks for the tip about Fabric, I'll check it out.Re: I Accidentally Deleted All Our Data
#10Although direct database update isn't recommended in SAP, still for some strange reasons it was needed in one of the projects to modify a wrong entry done by functional consultant. One of my fellow programmer was assigned this task and this is what she did - Update set = instead of Update set = where The code was executed on development server(thankfully) and it created a big mess. Full day work of 5 guys was lost. P…
Sounds like a poor manager to me.