From 6b3f2dc8709a8509ea5b365683c2ae8ae0e433dc Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Tue, 3 Mar 2015 14:05:45 +0100 Subject: reproducible: stats_builds_per_day needs (datum, suite) as primary key --- bin/reproducible_db_maintenance.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 + '")'], } -- cgit v1.2.3-70-g09d2