From 3f5fc85a8b8ae6ef11a664d88f426dc4dc0454ad Mon Sep 17 00:00:00 2001 From: philipp Date: Thu, 26 Oct 2023 20:37:48 +0200 Subject: [PATCH] fix --- migration.sql | 2 +- src/model/stat.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/migration.sql b/migration.sql index 4c87b1a..bff1516 100644 --- a/migration.sql +++ b/migration.sql @@ -86,7 +86,7 @@ CREATE TABLE IF NOT EXISTS "logbook_type" ( CREATE TABLE IF NOT EXISTS "logbook" ( "id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "boat_id" INTEGER NOT NULL REFERENCES boat(id), - "shipmaster" INTEGER NOT NULL REFERENCES user(id), -- null: club is owner + "shipmaster" INTEGER NOT NULL REFERENCES user(id), "shipmaster_only_steering" boolean not null, "departure" datetime not null, "arrival" datetime, -- None -> ship is on water diff --git a/src/model/stat.rs b/src/model/stat.rs index 994f91c..d60816a 100644 --- a/src/model/stat.rs +++ b/src/model/stat.rs @@ -13,7 +13,7 @@ impl Stat { //TODO: switch to query! macro again (once upgraded to sqlite 3.42 on server) sqlx::query( " -SELECT u.name, SUM(sub.distance_in_km) AS rowed_km +SELECT u.name, CAST(SUM(sub.distance_in_km) AS INTEGER) AS rowed_km FROM user u INNER JOIN ( SELECT r.rower_id AS user_id, l.distance_in_km