X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fdakdb%2Fupdate5.py;h=a42e540cdabd01dc10c4f453fc5105fa2a2ecce0;hb=e2c4fd7f21c3b33cd7192bded5d6373e0ee90374;hp=f5357e8916d037b253866ca68102b31bc8ad45fb;hpb=2816c734fc3a4a784e5643c9c3c256ba0727fd63;p=dak.git diff --git a/dak/dakdb/update5.py b/dak/dakdb/update5.py index f5357e89..a42e540c 100755 --- a/dak/dakdb/update5.py +++ b/dak/dakdb/update5.py @@ -1,7 +1,7 @@ #!/usr/bin/env python """ -Database Update Script - Fix bin_assoc_by_arch view +Fix bin_assoc_by_arch view @contact: Debian FTP Master @copyright: 2009 Joerg Jaspert @@ -36,18 +36,16 @@ def do_update(self): print "Fixing bin_assoc_by_arch view" try: c = self.db.cursor() - c.execute("DROP VIEW bin_assoc_by_arch") c.execute("""CREATE OR REPLACE VIEW bin_assoc_by_arch AS SELECT ba.suite, ba.bin, a.id AS arch FROM bin_associations ba JOIN binaries b ON ba.bin = b.id, architecture a - WHERE a.id > 2 AND (b.architecture = 2 OR b.architecture = a.id) - """ + WHERE a.id > 2 AND (b.architecture = 2 OR b.architecture = a.id) """) c.execute("UPDATE config SET value = '5' WHERE name = 'db_revision'") self.db.commit() - except psycopg2.ProgrammingError, msg: + except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, "Unable to recreate bin_assoc_by_arch view, rollback issued. Error message : %s" % (str(msg)) + raise DBUpdateError("Unable to recreate bin_assoc_by_arch view, rollback issued. Error message : %s" % (str(msg)))