From 7b5da3c5b65ee5633c42616d3e6ca3f3c7d4785c Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Wed, 7 Oct 2020 16:48:12 +0200 Subject: add build architecture to schema of builds table --- build.py | 9 +++++---- schema.sql | 3 ++- webapp.py | 6 ++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build.py b/build.py index 340802b..e7eea33 100755 --- a/build.py +++ b/build.py @@ -93,10 +93,11 @@ def main(): do_build(source, version, architecture, args.server) with contextlib.closing(db.cursor()) as cur: cur.execute("""INSERT INTO builds - (source, version, architecture, success, starttime, - filename) VALUES (?, ?, ?, ?, ?, ?);""", - (source, version, architecture, success, timestamp, - filename)) + (source, version, buildarch, hostarch, success, + starttime, filename) + VALUES (?, ?, ?, ?, ?, ?);""", + (source, version, 'amd64', architecture, success, + timestamp, filename)) if requestid is not None: cur.execute("DELETE FROM buildrequests WHERE id = ?;", (requestid,)) diff --git a/schema.sql b/schema.sql index 56184be..3569eac 100644 --- a/schema.sql +++ b/schema.sql @@ -25,7 +25,8 @@ INSERT INTO depcheck (architecture, releasetime, updatetime, giveback) VALUES CREATE TABLE builds ( source TEXT NOT NULL, version TEXT NOT NULL, - architecture TEXT NOT NULL, + buildarch TEXT NOT NULL, + hostarch TEXT NOT NULL, success BOOLEAN NOT NULL CHECK (success in (0, 1)), starttime TIMESTAMP NOT NULL, filename TEXT NOT NULL); diff --git a/webapp.py b/webapp.py index cc9de37..3d3af0d 100644 --- a/webapp.py +++ b/webapp.py @@ -370,8 +370,7 @@ def collect_depstate(conn, source): def show_index(): with db.engine.connect() as conn: builds = list(conn.execute(""" - SELECT source, version, 'amd64' AS buildarch, - architecture AS hostarch, starttime, filename, + SELECT source, version, buildarch, hostarch, starttime, filename, ifnull((SELECT max(patched + 1) FROM bugs WHERE affects = source), 0) AS buglvl @@ -392,8 +391,7 @@ def show_source(source): context["version"], context["depresult"] = collect_depstate(conn, source) query = sqlalchemy.text(""" - SELECT version, 'amd64' AS buildarch, architecture AS hostarch, - success, starttime, filename + SELECT version, buildarch, hostarch, success, starttime, filename FROM builds WHERE source = :source;""") context["builds"] = list(conn.execute(query, source=source)) query = sqlalchemy.text(""" -- cgit v1.2.3