X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fupdate_db.py;h=f7d13750d9be48738ee8cb7c78d6ac4c77a28b3a;hb=9f371390bb90395b2f2f0b65c91c21047896774a;hp=8bb88f65c41a71685a7b2aff385bd82fba374992;hpb=1483a68353fe374254379f4560cc245fbf2523d4;p=dak.git diff --git a/dak/update_db.py b/dak/update_db.py index 8bb88f65..f7d13750 100755 --- a/dak/update_db.py +++ b/dak/update_db.py @@ -137,9 +137,15 @@ Updates dak's database schema to the lastest version. You should disable crontab for i in range (database_revision, required_database_schema): print "updating databse schema from " + str(database_revision) + " to " + str(i+1) - dakdb = __import__("dakdb", globals(), locals(), ['update'+str(i+1)]) - update_module = getattr(dakdb, "update"+str(i+1)) - update_module.do_update(self) + try: + dakdb = __import__("dakdb", globals(), locals(), ['update'+str(i+1)]) + update_module = getattr(dakdb, "update"+str(i+1)) + update_module.do_update(self) + except DBUpdateError, e: + # Seems the update did not work. + print "Was unable to update database schema from %s to %s." % (str(database_revision), str(i+1)) + print "The error message received was %s" % (e) + utils.fubar("DB Schema upgrade failed") database_revision += 1 ################################################################################