From 8fbdf337ce6ccfea3aac3437ce47964d33dc5d9e Mon Sep 17 00:00:00 2001 From: Mark Hymers Date: Sat, 31 Oct 2009 20:20:55 +0000 Subject: [PATCH] sort out permission columns Signed-off-by: Mark Hymers --- dak/dakdb/update22.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/dak/dakdb/update22.py b/dak/dakdb/update22.py index 7234555e..4f95262d 100755 --- a/dak/dakdb/update22.py +++ b/dak/dakdb/update22.py @@ -56,9 +56,12 @@ def do_update(self): print "Adding policy_queue table" c.execute("""CREATE TABLE policy_queue ( - id SERIAL PRIMARY KEY, - queue_name TEXT NOT NULL UNIQUE, - path TEXT NOT NULL)""") + id SERIAL PRIMARY KEY, + queue_name TEXT NOT NULL UNIQUE, + path TEXT NOT NULL, + perms CHAR(4) NOT NULL DEFAULT '0660' CHECK (perms SIMILAR TO '^[0-7][0-7][0-7][0-7]$'), + change_perms CHAR(4) NOT NULL DEFAULT '0660' CHECK (change_perms SIMILAR TO '^[0-7][0-7][0-7][0-7]$') + )""") print "Copying queues" queues = {} @@ -204,6 +207,9 @@ def do_update(self): print "Getting rid of old queue table" c.execute("""DROP TABLE queue""") + print "Sorting out permission columns" + c.execute("""UPDATE policy_queue SET perms = '0664' WHERE queue_name IN ('proposedupdates', 'oldproposedupdates')""") + print "Moving known_changes table" c.execute("""ALTER TABLE known_changes RENAME TO changes""") -- 2.39.5