X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=dak%2Fdakdb%2Fupdate4.py;h=8c55d09b219066407a0fba9d9255f9d73aca0aa5;hb=3670b5f49b4d70a8eaf7ac24f50a541c9286fde2;hp=487b4792d94d0b709e5a6944177c42612032fa95;hpb=8d5c033bb1cc903c5ce7dc87b4122ea441fa28a3;p=dak.git diff --git a/dak/dakdb/update4.py b/dak/dakdb/update4.py index 487b4792..8c55d09b 100755 --- a/dak/dakdb/update4.py +++ b/dak/dakdb/update4.py @@ -27,17 +27,18 @@ Database Update Script - Get suite_architectures table use sane values import psycopg2 from daklib.dak_exceptions import DBUpdateError +from daklib.utils import get_conf ################################################################################ suites = {} #: Cache of existing suites archs = {} #: Cache of existing architectures - def do_update(self): """ Execute the DB update """ print "Lets make suite_architecture table use sane values" + Cnf = get_conf() query = "INSERT into suite_architectures (suite, architecture) VALUES (%s, %s)" #: Update query try: @@ -59,7 +60,9 @@ def do_update(self): architectures = Cnf.SubTree("Suite::" + suite).ValueList("Architectures") suite = suite.lower() for arch in architectures: - c.execute(query, suites[suite], archs[arch]) + c.execute(query, [suites[suite], archs[arch]]) + + c.execute("UPDATE config SET value = '4' WHERE name = 'db_revision'") self.db.commit()