]> git.decadent.org.uk Git - dak.git/commitdiff
fix up policy_queue support in the ORM and drop old column
authorMark Hymers <mhy@debian.org>
Fri, 30 Oct 2009 13:49:38 +0000 (13:49 +0000)
committerMark Hymers <mhy@debian.org>
Fri, 30 Oct 2009 13:49:38 +0000 (13:49 +0000)
Signed-off-by: Mark Hymers <mhy@debian.org>
dak/dakdb/update20.py
daklib/dbconn.py

index 61497c21faa5265171a080fd54965d88f80ebe73..27df549b84911740112cc41cae8a7e6d0287ae91 100755 (executable)
@@ -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')
index 45e000d395fbf104a8331004e7a95451114ba1f6..75d271bd39d1cbff799fa9b02d68cfa8345b6f5d 100755 (executable)
@@ -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,