summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2015-03-03 14:18:06 +0100
committerHolger Levsen <holger@layer-acht.org>2015-03-03 14:18:06 +0100
commit4c8b5a6b607a3f022875e925c4bd316fb92245b7 (patch)
tree7dcefefd56ed2a8a157684aaf34e7125116bfe10
parent6b3f2dc8709a8509ea5b365683c2ae8ae0e433dc (diff)
downloadjenkins.debian.net-4c8b5a6b607a3f022875e925c4bd316fb92245b7.tar.xz
reproducible: stats_builds_age needs (datum, suite) as primary key
-rwxr-xr-xbin/reproducible_db_maintenance.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/bin/reproducible_db_maintenance.py b/bin/reproducible_db_maintenance.py
index e8c6c609..c1ab6d20 100755
--- a/bin/reproducible_db_maintenance.py
+++ b/bin/reproducible_db_maintenance.py
@@ -251,6 +251,21 @@ schema_updates = {
'''DROP TABLE stats_builds_per_day;''',
'''ALTER TABLE stats_builds_per_day_tmp RENAME TO stats_builds_per_day;''',
'INSERT INTO rb_schema VALUES ("5", "' + now + '")'],
+ 6: [ # stats_builds_age needs (datum, suite) as primary key
+ '''CREATE TABLE stats_builds_age_tmp
+ (datum TEXT NOT NULL,
+ suite TEXT NOT NULL,
+ oldest_reproducible REAL,
+ oldest_unreproducible REAL,
+ oldest_FTBFS REAL,
+ PRIMARY KEY (datum, suite))''',
+ '''INSERT INTO stats_builds_age_tmp (datum, suite,
+ oldest_reproducible, oldest_unreproducible, oldest_FTBFS)
+ SELECT datum, suite, oldest_reproducible, oldest_unreproducible,
+ FTBFS FROM stats_builds_age;''',
+ '''DROP TABLE stats_builds_age;''',
+ '''ALTER TABLE stats_builds_age_tmp RENAME TO stats_builds_age;''',
+ 'INSERT INTO rb_schema VALUES ("6", "' + now + '")'],
}