summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_db_maintenance.py
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2015-10-15 10:43:44 +0000
committerHolger Levsen <holger@layer-acht.org>2015-12-09 11:28:32 +0100
commita3722c8457f22264c8d2850925addffb01e40e94 (patch)
tree627c4b477fd238d2315710b9485a6e73be611105 /bin/reproducible_db_maintenance.py
parent058954f967672a719c930a783af3b23d97d632e2 (diff)
downloadjenkins.debian.net-a3722c8457f22264c8d2850925addffb01e40e94.tar.xz
reproducible: store in the db also the actual build host in stats_build, and rename the current "builder" field to "job", since it contains the jenkins job name and nummber
Diffstat (limited to 'bin/reproducible_db_maintenance.py')
-rwxr-xr-xbin/reproducible_db_maintenance.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/bin/reproducible_db_maintenance.py b/bin/reproducible_db_maintenance.py
index 33cc38be..47b50637 100755
--- a/bin/reproducible_db_maintenance.py
+++ b/bin/reproducible_db_maintenance.py
@@ -483,6 +483,28 @@ schema_updates = {
'''DROP TABLE stats_builds_age;''',
'''ALTER TABLE stats_builds_age_tmp RENAME TO stats_builds_age;''',
'INSERT INTO rb_schema VALUES ("22", "' + now + '")'],
+ 23: [ # save which builders built a package and change the name of the
+ # field keeping the job name
+ '''CREATE TABLE stats_build_tmp
+ (id INTEGER PRIMARY KEY,
+ name TEXT NOT NULL,
+ version TEXT NOT NULL,
+ suite TEXT NOT NULL,
+ architecture TEXT NOT NULL,
+ status TEXT NOT NULL,
+ build_date TEXT NOT NULL,
+ build_duration TEXT NOT NULL,
+ node1 TEXT NOT NULL DEFAULT "",
+ node2 TEXT NOT NULL DEFAULT "",
+ job TEXT NOT NULL,
+ UNIQUE (name, version, suite, architecture, build_date))''',
+ '''INSERT INTO stats_build_tmp (id, name, version, suite, architecture,
+ status, build_date, build_duration, job)
+ SELECT id, name, version, suite, architecture, status, build_date,
+ build_duration, builder FROM stats_build''',
+ 'DROP TABLE stats_build',
+ 'ALTER TABLE stats_build_tmp RENAME TO stats_build',
+ 'INSERT INTO rb_schema VALUES ("23", "' + now + '")'],
}