summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_db_maintenance.py
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2015-10-17 23:44:30 +0000
committerHolger Levsen <holger@layer-acht.org>2015-12-09 11:28:32 +0100
commite8a1da03fee36b81a2fb75e3c564237e66931a5c (patch)
tree9cd4c90e970002bf4f6a0841f9a6e44c62a930f1 /bin/reproducible_db_maintenance.py
parent1399d204bf1c6da365fca261c04cd72e86ecadba (diff)
downloadjenkins.debian.net-e8a1da03fee36b81a2fb75e3c564237e66931a5c.tar.xz
reproducible db: s,builder,job, also in the schedule table.
Diffstat (limited to 'bin/reproducible_db_maintenance.py')
-rwxr-xr-xbin/reproducible_db_maintenance.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/bin/reproducible_db_maintenance.py b/bin/reproducible_db_maintenance.py
index ec01205c..9bed6591 100755
--- a/bin/reproducible_db_maintenance.py
+++ b/bin/reproducible_db_maintenance.py
@@ -525,6 +525,27 @@ schema_updates = {
'DROP TABLE results',
'ALTER TABLE results_tmp RENAME TO results',
'INSERT INTO rb_schema VALUES ("24", "' + now + '")'],
+ 25: [ # rename the builder column also on the schedule table.
+ '''CREATE TABLE schedule_tmp
+ (id INTEGER PRIMARY KEY,
+ package_id INTEGER NOT NULL,
+ date_scheduled TEXT NOT NULL,
+ scheduler TEXT,
+ date_build_started TEXT,
+ job TEXT,
+ notify TEXT NOT NULL DEFAULT '',
+ save_artifacts INTEGER DEFAULT 0,
+ UNIQUE (package_id),
+ FOREIGN KEY(package_id) REFERENCES sources(id))''',
+ 'UPDATE schedule SET notify = "" WHERE notify IS NULL',
+ '''INSERT INTO schedule_tmp (id, package_id, date_scheduled, scheduler,
+ date_build_started, job, notify, save_artifacts)
+ SELECT id, package_id, date_scheduled, scheduler,
+ date_build_started, builder, notify, save_artifacts
+ FROM schedule''',
+ 'DROP TABLE schedule',
+ 'ALTER TABLE schedule_tmp RENAME TO schedule',
+ 'INSERT INTO rb_schema VALUES ("25", "' + now + '")'],
}