Saved by bad programming

Today my boss decided to test out the “Delete” buttons on our online education platform (http://my.dts.edu/).  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 thoughts on “Saved by bad programming

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

  2. lucky….

    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 )

  3. how about a simple Active bit and clean up later

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

Comments are closed.