X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fdakdb%2Fupdate17.py;h=493640eb9ff6a79df097a345d17424a5ebbcc1ad;hb=9eff87cf703b5fe3310570ab30ff922e62f2957a;hp=b5bbb3cce22bd805cdfc92a39bc1a55caf7438c9;hpb=2a96091acb1b1eaf66f181e95872771878290885;p=dak.git diff --git a/dak/dakdb/update17.py b/dak/dakdb/update17.py index b5bbb3cc..493640eb 100644 --- a/dak/dakdb/update17.py +++ b/dak/dakdb/update17.py @@ -44,7 +44,7 @@ def do_update(self): file text, binary_id integer, UNIQUE(file,binary_id))""" ) - + c.execute("""ALTER TABLE ONLY bin_contents ADD CONSTRAINT bin_contents_bin_fkey FOREIGN KEY (binary_id) REFERENCES binaries(id) @@ -54,12 +54,13 @@ def do_update(self): c.execute("GRANT ALL ON bin_contents TO ftpmaster;") c.execute("GRANT SELECT ON bin_contents TO public;") + c.execute("UPDATE config SET value = '17' WHERE name = 'db_revision'") self.db.commit() - except psycopg2.ProgrammingError, msg: + except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, "Unable to apply process-new update 17, rollback issued. Error message : %s" % (str(msg)) + raise DBUpdateError("Unable to apply process-new update 17, rollback issued. Error message : %s" % (str(msg)))