]> git.decadent.org.uk Git - dak.git/blobdiff - dak/dakdb/update17.py
Convert exception handling to Python3 syntax.
[dak.git] / dak / dakdb / update17.py
old mode 100644 (file)
new mode 100755 (executable)
index 0d7efa9..8fc3bd0
@@ -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,9 +52,13 @@ 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))