From 4c8b5a6b607a3f022875e925c4bd316fb92245b7 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Tue, 3 Mar 2015 14:18:06 +0100 Subject: reproducible: stats_builds_age needs (datum, suite) as primary key --- bin/reproducible_db_maintenance.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'bin/reproducible_db_maintenance.py') 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 + '")'], } -- cgit v1.2.3-54-g00ecf