[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[dak/master 2/2] fix up policy_queue support in the ORM and drop old column



Signed-off-by: Mark Hymers <mhy@debian.org>
---
 dak/dakdb/update20.py |    3 ++-
 daklib/dbconn.py      |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/dak/dakdb/update20.py b/dak/dakdb/update20.py
index 61497c2..27df549 100755
--- a/dak/dakdb/update20.py
+++ b/dak/dakdb/update20.py
@@ -80,7 +80,8 @@ def do_update(self):
         c.execute("ALTER TABLE known_changes ADD COLUMN approved_for INT4 REFERENCES queue(id) DEFAULT NULL")
 
         print "Adding policy queue column to suite table"
-        c.execute("ALTER TABLE suite ADD COLUMN policy_queue INT4 REFERENCES queue(id) DEFAULT NULL")
+        c.execute("ALTER TABLE suite DROP COLUMN policy_engine")
+        c.execute("ALTER TABLE suite ADD COLUMN policy_queue_id INT4 REFERENCES queue(id) DEFAULT NULL")
         # Handle some of our common cases automatically
         if seenqueues.has_key('proposedupdates'):
             c.execute("""UPDATE suite SET policy_queue = (SELECT id FROM queue WHERE queue_name = 'proposedupdates')
diff --git a/daklib/dbconn.py b/daklib/dbconn.py
index 45e000d..75d271b 100755
--- a/daklib/dbconn.py
+++ b/daklib/dbconn.py
@@ -2552,7 +2552,8 @@ class DBConn(Singleton):
                                                        primaryjoin=(self.tbl_src_uploaders.c.maintainer==self.tbl_maintainer.c.id))))
 
         mapper(Suite, self.tbl_suite,
-               properties = dict(suite_id = self.tbl_suite.c.id))
+               properties = dict(suite_id = self.tbl_suite.c.id,
+                                 policy_queue = relation(Queue)))
 
         mapper(SuiteArchitecture, self.tbl_suite_architectures,
                properties = dict(suite_id = self.tbl_suite_architectures.c.suite,
-- 
1.6.3.3


Reply to: