From c11b73b7e61e8968905382c08227ae6bb5dd13e7 Mon Sep 17 00:00:00 2001 From: philipp Date: Thu, 2 Nov 2023 18:33:30 +0100 Subject: [PATCH 1/5] remove db migration as ergo changes are in prod. --- staging-diff.sql | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/staging-diff.sql b/staging-diff.sql index 59dcf12..f2786a1 100644 --- a/staging-diff.sql +++ b/staging-diff.sql @@ -18,13 +18,3 @@ DROP TABLE logbook; ALTER TABLE logbook_temp RENAME TO logbook; INSERT INTO rower(rower_id, logbook_id) SELECT shipmaster, id FROM logbook; - - - --- tmp ergo challenge stuff -ALTER TABLE user ADD COLUMN dob text; -ALTER TABLE user ADD COLUMN weight text; -ALTER TABLE user ADD COLUMN sex text; -ALTER TABLE user ADD COLUMN dirty_thirty text; -ALTER TABLE user ADD COLUMN dirty_dozen text; - From 27e40783e14ae18583d8aeaa187045e6566128e1 Mon Sep 17 00:00:00 2001 From: philipp Date: Thu, 2 Nov 2023 18:59:33 +0100 Subject: [PATCH 2/5] image required; cleaner log --- src/tera/ergo.rs | 10 ++++++++-- templates/ergo.html.tera | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/tera/ergo.rs b/src/tera/ergo.rs index 81af3b5..b2a8aab 100644 --- a/src/tera/ergo.rs +++ b/src/tera/ergo.rs @@ -139,7 +139,10 @@ async fn new_thirty( Log::create( db, - format!("{created_by:?} created thirty-ergo entry: {data:?}"), + format!( + "{} created thirty-ergo entry: {data:?}", + created_by.user.name + ), ) .await; @@ -176,7 +179,10 @@ async fn new_dozen( Log::create( db, - format!("{created_by:?} created dozen-ergo entry: {data:?}"), + format!( + "{} created dozen-ergo entry: {data:?}", + created_by.user.name + ), ) .await; diff --git a/templates/ergo.html.tera b/templates/ergo.html.tera index 2ecc90f..3d58e73 100644 --- a/templates/ergo.html.tera +++ b/templates/ergo.html.tera @@ -20,7 +20,7 @@ {% endfor %} {{ macros::input(label="Zeit [(hh:)mm:ss]/Distanz [m]", name="result", required=true, type="text", class="input") }} - + @@ -40,7 +40,7 @@ {% endfor %} {{ macros::input(label="Zeit [(hh:)mm:ss]/Distanz [m]", name="result", required=true, type="text", class="input") }} - + From 71da6546b09a10809b156f3392ff79e208a62e2f Mon Sep 17 00:00:00 2001 From: philipp Date: Thu, 2 Nov 2023 18:59:33 +0100 Subject: [PATCH 3/5] image required; cleaner log --- src/tera/ergo.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/tera/ergo.rs b/src/tera/ergo.rs index 81af3b5..b2a8aab 100644 --- a/src/tera/ergo.rs +++ b/src/tera/ergo.rs @@ -139,7 +139,10 @@ async fn new_thirty( Log::create( db, - format!("{created_by:?} created thirty-ergo entry: {data:?}"), + format!( + "{} created thirty-ergo entry: {data:?}", + created_by.user.name + ), ) .await; @@ -176,7 +179,10 @@ async fn new_dozen( Log::create( db, - format!("{created_by:?} created dozen-ergo entry: {data:?}"), + format!( + "{} created dozen-ergo entry: {data:?}", + created_by.user.name + ), ) .await; From 0bbedfc9cc1a99a26efd12b6267cc1ba6753e7c1 Mon Sep 17 00:00:00 2001 From: philipp Date: Thu, 2 Nov 2023 19:11:23 +0100 Subject: [PATCH 4/5] remove staging diff as it's deployed --- staging-diff.sql | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/staging-diff.sql b/staging-diff.sql index f2786a1..e69de29 100644 --- a/staging-diff.sql +++ b/staging-diff.sql @@ -1,20 +0,0 @@ -ALTER TABLE logbook ADD COLUMN "steering_person" INTEGER NOT NULL DEFAULT 0 REFERENCES user(id); -UPDATE logbook SET steering_person = shipmaster; -CREATE TABLE "logbook_temp" ( - "id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, - "boat_id" INTEGER NOT NULL REFERENCES boat(id), - "shipmaster" INTEGER NOT NULL REFERENCES user(id), - "steering_person" INTEGER NOT NULL DEFAULT 1 REFERENCES user(id), - "shipmaster_only_steering" boolean not null, - "departure" datetime not null, - "arrival" datetime, - "destination" text, - "distance_in_km" integer, - "comments" text, - "logtype" INTEGER REFERENCES logbook_type(id) -); -INSERT INTO logbook_temp(id, boat_id, shipmaster, shipmaster_only_steering, departure, arrival, destination, distance_in_km, comments, logtype) SELECT id, boat_id, shipmaster, shipmaster_only_steering, COALESCE(departure, '2000-01-01 00:00:00'), arrival, destination, distance_in_km, comments, logtype FROM logbook; -DROP TABLE logbook; -ALTER TABLE logbook_temp RENAME TO logbook; - -INSERT INTO rower(rower_id, logbook_id) SELECT shipmaster, id FROM logbook; From eb0f3ba9d8fdd198efa537bc6b26a5652cb500c2 Mon Sep 17 00:00:00 2001 From: philipp Date: Thu, 2 Nov 2023 19:32:16 +0100 Subject: [PATCH 5/5] clearer label --- templates/includes/forms/log.html.tera | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/includes/forms/log.html.tera b/templates/includes/forms/log.html.tera index 627dea9..b4a1b72 100644 --- a/templates/includes/forms/log.html.tera +++ b/templates/includes/forms/log.html.tera @@ -76,7 +76,7 @@ {% macro rower_select(id, selected, amount_seats='', class='', init='false', cox_on_boat='', steering_person_id='') %} {#{% if not amount_seats or amount_seats > 1 %}#}
- +