diff options
author | Holger Levsen <holger@layer-acht.org> | 2015-08-19 18:26:52 +0200 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2015-08-19 18:26:52 +0200 |
commit | 6c5f38a1e790c0c84594215a1da51ffa9ca88a5f (patch) | |
tree | d247ba079ca5f219226c6f58115d7b4f8de04bdd /bin/reproducible_db_maintenance.py | |
parent | 816510db46d42d04e158a3a46dea830e63631bf2 (diff) | |
download | jenkins.debian.net-6c5f38a1e790c0c84594215a1da51ffa9ca88a5f.tar.xz |
reproducible: keep arch specific stats and introduce suite_$arch_stats
Diffstat (limited to 'bin/reproducible_db_maintenance.py')
-rwxr-xr-x | bin/reproducible_db_maintenance.py | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/bin/reproducible_db_maintenance.py b/bin/reproducible_db_maintenance.py index a8642b91..527e3686 100755 --- a/bin/reproducible_db_maintenance.py +++ b/bin/reproducible_db_maintenance.py @@ -427,6 +427,62 @@ schema_updates = { '''ALTER TABLE stats_bugs ADD COLUMN open_locale INTEGER DEFAULT "0"''', '''ALTER TABLE stats_bugs ADD COLUMN done_locale INTEGER DEFAULT "0"''', 'INSERT INTO rb_schema VALUES ("18", "' + now + '")'], + 19: [ # add column architecture to stats_pkg_state and use (datum, suite, architecture) as primary key + '''CREATE TABLE stats_pkg_state_tmp + (datum TEXT NOT NULL, + suite TEXT NOT NULL, + architecture TEXT NOT NULL, + untested INTEGER, + reproducible INTEGER, + unreproducible INTEGER, + FTBFS INTEGER, + other INTEGER, + PRIMARY KEY (datum, suite, architecture))''', + '''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 ("19", "' + now + '")'], + 20: [ # add column architecture to stats_builds_per_day and use (datum, suite, architecture) as primary key + '''CREATE TABLE stats_builds_per_day_tmp + (datum TEXT NOT NULL, + suite TEXT NOT NULL, + architecture TEXT NOT NULL, + reproducible INTEGER, + unreproducible INTEGER, + FTBFS INTEGER, + other INTEGER, + PRIMARY KEY (datum, suite, architecture))''', + '''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 ("20", "' + now + '")'], + 21: [ # add column architecture to stats_builds_age and use (datum, suite, architecture) as primary key + '''CREATE TABLE stats_builds_age_tmp + (datum TEXT NOT NULL, + suite TEXT NOT NULL, + architecture TEXT NOT NULL, + oldest_reproducible REAL, + oldest_unreproducible REAL, + oldest_FTBFS REAL, + PRIMARY KEY (datum, suite, architecture))''', + '''INSERT INTO stats_builds_age_tmp (datum, suite, + oldest_reproducible, oldest_unreproducible, oldest_FTBFS) + SELECT datum, suite, oldest_reproducible, oldest_unreproducible, + oldest_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 ("21", "' + now + '")'], + 22: [ # we've only tested amd64 so far + 'UPDATE stats_pkg_state SET architecture = "amd64" WHERE architecture = ""', + 'UPDATE stats_builds_per_day SET architecture = "amd64" WHERE architecture = ""', + 'UPDATE stats_builds_age SET architecture = "amd64" WHERE architecture = ""', + 'INSERT INTO rb_schema VALUES ("22", "' + now + '")'], } |