X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fdakdb%2Fupdate17.py;h=493640eb9ff6a79df097a345d17424a5ebbcc1ad;hb=1f50da26dd16e8e86b946ae8189c7f773fce70f4;hp=0d7efa9efec6c77e325aaa4c885e1766477452d4;hpb=778f521cd0cbd2093896c2476738377dc58e41b7;p=dak.git diff --git a/dak/dakdb/update17.py b/dak/dakdb/update17.py index 0d7efa9e..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) @@ -52,11 +52,15 @@ def do_update(self): c.execute("""CREATE INDEX ind_bin_contents_binary ON bin_contents(binary_id);""" ) + 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)))