From 22af280c8255d52d53ce33312c0d5305576fd68c Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Mon, 2 Mar 2015 11:35:54 +0100 Subject: reproducible: update db schema: stats_pkg_state needs (datum, suite) as primary key --- bin/reproducible_db_maintenance.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'bin') diff --git a/bin/reproducible_db_maintenance.py b/bin/reproducible_db_maintenance.py index 7ed20338..4a1be9f4 100755 --- a/bin/reproducible_db_maintenance.py +++ b/bin/reproducible_db_maintenance.py @@ -218,6 +218,23 @@ schema_updates = { '''ALTER TABLE stats_bugs ADD COLUMN open_umask INTEGER''', '''ALTER TABLE stats_bugs ADD COLUMN done_umask INTEGER''', 'INSERT INTO rb_schema VALUES ("3", "' + now + '")'], + 4: [ # stats_pkg_state needs (datum, suite) as primary key + '''CREATE TABLE stats_pkg_state_tmp + (datum TEXT NOT NULL, + suite TEXT NOT NULL, + untested INTEGER, + reproducible INTEGER, + unreproducible INTEGER, + FTBFS INTEGER, + other INTEGER, + PRIMARY KEY (datum, suite))''', + '''INSERT INTO stats_pkg_state_tmp (datum, suite, untested, + reproducible, unreproducible, FTBFS, other) + SELECT datum, suite, untested, reproducible, unreproducible, + FTBFS, other FROM stats_pkg_state;''', + '''DROP TABLE stats_pkg_state;''', + '''ALTER TABLE stats_pkg_state_tmp RENAME TO stats_pkg_state;''', + 'INSERT INTO rb_schema VALUES ("4", "' + now + '")'], } -- cgit v1.2.3-70-g09d2