Package buildbot :: Package db :: Package schema :: Module v2
[frames] | no frames]

Source Code for Module buildbot.db.schema.v2

 1   
 2  from buildbot.db.schema import base 
 3   
4 -class Upgrader(base.Upgrader):
5 - def upgrade(self):
6 self.add_columns() 7 self.set_version()
8
9 - def add_columns(self):
10 cursor = self.conn.cursor() 11 cursor.execute(""" 12 ALTER TABLE changes 13 add column `repository` text not null default '' 14 """) 15 cursor.execute(""" 16 ALTER TABLE changes 17 add column `project` text not null default '' 18 """) 19 cursor.execute(""" 20 ALTER TABLE sourcestamps 21 add column `repository` text not null default '' 22 """) 23 cursor.execute(""" 24 ALTER TABLE sourcestamps 25 add column `project` text not null default '' 26 """)
27
28 - def set_version(self):
29 c = self.conn.cursor() 30 c.execute("""UPDATE version set version = 2 where version = 1""")
31