summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_db_maintenance.py
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2015-10-17 23:22:34 +0000
committerHolger Levsen <holger@layer-acht.org>2015-12-09 11:28:32 +0100
commit1399d204bf1c6da365fca261c04cd72e86ecadba (patch)
tree658dfe5c097bd9afaeb7e8a26e87999368b01e27 /bin/reproducible_db_maintenance.py
parenta3722c8457f22264c8d2850925addffb01e40e94 (diff)
downloadjenkins.debian.net-1399d204bf1c6da365fca261c04cd72e86ecadba.tar.xz
reproducible db: rename column in the results table: s#builder#job, and add build nodes information
Diffstat (limited to 'bin/reproducible_db_maintenance.py')
-rwxr-xr-xbin/reproducible_db_maintenance.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/bin/reproducible_db_maintenance.py b/bin/reproducible_db_maintenance.py
index 47b50637..ec01205c 100755
--- a/bin/reproducible_db_maintenance.py
+++ b/bin/reproducible_db_maintenance.py
@@ -505,6 +505,26 @@ schema_updates = {
'DROP TABLE stats_build',
'ALTER TABLE stats_build_tmp RENAME TO stats_build',
'INSERT INTO rb_schema VALUES ("23", "' + now + '")'],
+ 24: [ # the same as #23 but for the results table
+ '''CREATE TABLE results_tmp
+ (id INTEGER PRIMARY KEY,
+ package_id INTEGER NOT NULL,
+ version TEXT NOT NULL,
+ status TEXT NOT NULL,
+ build_date TEXT NOT NULL,
+ build_duration INTEGER DEFAULT 0,
+ node1 TEXT,
+ node2 TEXT,
+ job TEXT NOT NULL,
+ UNIQUE (package_id)
+ FOREIGN KEY(package_id) REFERENCES sources(id))''',
+ '''INSERT INTO results_tmp (id, package_id, version, status,
+ build_date, build_duration, job)
+ SELECT id, package_id, version, status, build_date, build_duration,
+ builder FROM results''',
+ 'DROP TABLE results',
+ 'ALTER TABLE results_tmp RENAME TO results',
+ 'INSERT INTO rb_schema VALUES ("24", "' + now + '")'],
}