Signed-off-by: Mark Hymers <mhy@debian.org>
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')
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,