Saved by bad programming

May 8, 2004 | Uncategorized | 4 Comments

Today my boss decided to test out the “Delete” buttons on our online education platform (  He actually deleted a course that 1) we’ve worked several weeks to build, 2) starts on Monday!

Besides the record for the courses, there are records for who is in the coures, assignments data, files, units, tasks, forums, groups etc. that are associated with the CourseID. Well I had stubbed in code to cascade delete all those other items so that the database would remain clean, but I never went in and finished writing all the SQL. Anyway, he deleted the course, but thankfully it was only the single record of the course.  All i had to do was figure out what the ID was and re-insert it.

So much for finishing the job! Now I’m the data recovery genius!

4 responses to “Saved by bad programming”

  1. Unresolvable says:

    Amen to that 😉

  2. Unresolvable says:

    What you should have been saved by is referrential integrity. Either that or a good backup (you do have those, right?) 🙂

  3. Unresolvable says:


    cascade deletes are also a bad idea btw, it’s nice th other way but in situations like that you would delete all the information that might be resuable for other courses.. ( not sure of you datamodel but you know what I mean )

  4. Unresolvable says:

    how about a simple Active bit and clean up later

    its faster, safer and has saved many a persons job and face.

Hi, I'm John Dyer. In my day job, I build websites and create online seminary software for a seminary in Dallas. I also like to release open source tools including a pretty popular HTML5 video player and build tools that help people find best bible commentaries and do bible study. And just for fun, I also wrote a book on the theology of technology and media.

Fork me on GitHub

Social Widgets powered by