]> git.decadent.org.uk Git - dak.git/blobdiff - dak/dakdb/update79.py
Use correct db_name for MD5 hash
[dak.git] / dak / dakdb / update79.py
old mode 100644 (file)
new mode 100755 (executable)
index 67ad01a..81a7b23
@@ -38,6 +38,7 @@ def do_update(self):
         c = self.db.cursor()
 
         c.execute("CREATE SCHEMA world");
+        c.execute("GRANT USAGE ON SCHEMA world TO PUBLIC")
         c.execute("ALTER DEFAULT PRIVILEGES IN SCHEMA world GRANT SELECT ON TABLES TO PUBLIC")
         c.execute("ALTER DEFAULT PRIVILEGES IN SCHEMA world GRANT ALL ON TABLES TO ftpmaster")
         c.execute("ALTER DEFAULT PRIVILEGES IN SCHEMA world GRANT SELECT ON SEQUENCES TO PUBLIC")
@@ -47,7 +48,7 @@ def do_update(self):
             CREATE OR REPLACE VIEW world."files-1" AS
               SELECT
                 files.id AS id,
-                CONCAT(component.name, '/', files.filename) AS filename,
+                component.name || '/' || files.filename AS filename,
                 files.size AS size,
                 files.md5sum AS md5sum,
                 files.sha1sum AS sha1sum,
@@ -62,9 +63,9 @@ def do_update(self):
             """)
 
 
-        c.execute("UPDATE config SET value = '78' WHERE name = 'db_revision'")
+        c.execute("UPDATE config SET value = '79' WHERE name = 'db_revision'")
         self.db.commit()
 
     except psycopg2.ProgrammingError as msg:
         self.db.rollback()
-        raise DBUpdateError('Unable to apply sick update 78, rollback issued. Error message: {0}'.format(msg))
+        raise DBUpdateError('Unable to apply sick update 79, rollback issued. Error message: {0}'.format(msg))