forked from buildbot/buildbot
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add project, repository columns to changes and sourcestamps tables
- Loading branch information
Dustin J. Mitchell
committed
Mar 10, 2010
1 parent
f5caea9
commit 214c120
Showing
4 changed files
with
55 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import os | ||
|
||
from buildbot.db import util | ||
from buildbot.db.schema import base | ||
|
||
class Upgrader(base.Upgrader): | ||
def upgrade(self): | ||
self.add_columns() | ||
self.set_version() | ||
|
||
def add_columns(self): | ||
cursor = self.conn.cursor() | ||
cursor.execute(""" | ||
ALTER TABLE changes | ||
add column `repository` text not null default '' | ||
""") | ||
cursor.execute(""" | ||
ALTER TABLE changes | ||
add column `project` text not null default '' | ||
""") | ||
cursor.execute(""" | ||
ALTER TABLE sourcestamps | ||
add column `repository` text not null default '' | ||
""") | ||
cursor.execute(""" | ||
ALTER TABLE sourcestamps | ||
add column `project` text not null default '' | ||
""") | ||
|
||
def set_version(self): | ||
c = self.conn.cursor() | ||
c.execute("""UPDATE version set version = 2 where version = 1""") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters