X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fdakdb%2Fupdate17.py;h=493640eb9ff6a79df097a345d17424a5ebbcc1ad;hb=e2c4fd7f21c3b33cd7192bded5d6373e0ee90374;hp=b5bbb3cce22bd805cdfc92a39bc1a55caf7438c9;hpb=7e1fd15629858d8b3437cb7626f853e74c461ec1;p=dak.git diff --git a/dak/dakdb/update17.py b/dak/dakdb/update17.py old mode 100644 new mode 100755 index b5bbb3cc..493640eb --- 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)))