summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_db_maintenance.py
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2015-03-03 14:05:45 +0100
committerHolger Levsen <holger@layer-acht.org>2015-03-03 14:05:45 +0100
commit6b3f2dc8709a8509ea5b365683c2ae8ae0e433dc (patch)
treec20d2fa7da95e2351b9635fe9095e9094090ecd8 /bin/reproducible_db_maintenance.py
parentad5ee5295736731d600b35bf0ac6ce1d86c2fb0b (diff)
downloadjenkins.debian.net-6b3f2dc8709a8509ea5b365683c2ae8ae0e433dc.tar.xz
reproducible: stats_builds_per_day needs (datum, suite) as primary key
Diffstat (limited to 'bin/reproducible_db_maintenance.py')
-rwxr-xr-xbin/reproducible_db_maintenance.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/bin/reproducible_db_maintenance.py b/bin/reproducible_db_maintenance.py
index 4a1be9f4..e8c6c609 100755
--- a/bin/reproducible_db_maintenance.py
+++ b/bin/reproducible_db_maintenance.py
@@ -235,6 +235,22 @@ schema_updates = {
'''DROP TABLE stats_pkg_state;''',
'''ALTER TABLE stats_pkg_state_tmp RENAME TO stats_pkg_state;''',
'INSERT INTO rb_schema VALUES ("4", "' + now + '")'],
+ 5: [ # stats_builds_per_day needs (datum, suite) as primary key
+ '''CREATE TABLE stats_builds_per_day_tmp
+ (datum TEXT NOT NULL,
+ suite TEXT NOT NULL,
+ reproducible INTEGER,
+ unreproducible INTEGER,
+ FTBFS INTEGER,
+ other INTEGER,
+ PRIMARY KEY (datum, suite))''',
+ '''INSERT INTO stats_builds_per_day_tmp (datum, suite,
+ reproducible, unreproducible, FTBFS, other)
+ SELECT datum, suite, reproducible, unreproducible,
+ FTBFS, other FROM stats_builds_per_day;''',
+ '''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 + '")'],
}