From 4199fadc0a77244ae795ed95bbc6ec6c5a8aaf87 Mon Sep 17 00:00:00 2001 From: philipp Date: Sun, 19 Nov 2023 22:19:28 +0100 Subject: [PATCH] use current year in test_db --- seeds.sql | 6 +++--- src/model/logbook.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/seeds.sql b/seeds.sql index 888f552..1b2ca6a 100644 --- a/seeds.sql +++ b/seeds.sql @@ -26,9 +26,9 @@ INSERT INTO "boat" (name, amount_seats, location_id) VALUES ('Ottensheim Boot', INSERT INTO "boat" (name, amount_seats, location_id, owner) VALUES ('second_private_boat_from_rower', 1, 1, 2); INSERT INTO "logbook_type" (name) VALUES ('Wanderfahrt'); INSERT INTO "logbook_type" (name) VALUES ('Regatta'); -INSERT INTO "logbook" (boat_id, shipmaster,steering_person, shipmaster_only_steering, departure) VALUES (2, 2, 2, false, '1142-12-24 10:00'); -INSERT INTO "logbook" (boat_id, shipmaster, steering_person, shipmaster_only_steering, departure, arrival, destination, distance_in_km) VALUES (1, 4, 4, false, '1141-12-24 10:00', '2141-12-24 15:00', 'Ottensheim', 25); -INSERT INTO "logbook" (boat_id, shipmaster, steering_person, shipmaster_only_steering, departure, arrival, destination, distance_in_km) VALUES (3, 4, 4, false, '1142-12-24 10:00', '2142-12-24 11:30', 'Ottensheim + Regattastrecke', 29); +INSERT INTO "logbook" (boat_id, shipmaster,steering_person, shipmaster_only_steering, departure) VALUES (2, 2, 2, false, strftime('%Y', 'now') || '-12-24 10:00'); +INSERT INTO "logbook" (boat_id, shipmaster, steering_person, shipmaster_only_steering, departure, arrival, destination, distance_in_km) VALUES (1, 4, 4, false, strftime('%Y', 'now') || '-12-24 10:00', strftime('%Y', 'now') || '-12-24 15:00', 'Ottensheim', 25); +INSERT INTO "logbook" (boat_id, shipmaster, steering_person, shipmaster_only_steering, departure, arrival, destination, distance_in_km) VALUES (3, 4, 4, false, strftime('%Y', 'now') || '-12-24 10:00', strftime('%Y', 'now') || '-12-24 11:30', 'Ottensheim + Regattastrecke', 29); INSERT INTO "rower" (logbook_id, rower_id) VALUES(3,3); INSERT INTO "boat_damage" (boat_id, desc, user_id_created, created_at) VALUES(4,'Dolle bei Position 2 fehlt', 5, '2142-12-24 15:02'); INSERT INTO "boat_damage" (boat_id, desc, user_id_created, created_at, lock_boat) VALUES(5, 'TOHT', 5, '2142-12-24 15:02', 1); diff --git a/src/model/logbook.rs b/src/model/logbook.rs index aef9eda..1c05c8b 100644 --- a/src/model/logbook.rs +++ b/src/model/logbook.rs @@ -553,11 +553,11 @@ mod test { assert_eq!( completed[0].logbook, - Logbook::find_by_id(&pool, 3).await.unwrap() + Logbook::find_by_id(&pool, 2).await.unwrap() ); assert_eq!( completed[1].logbook, - Logbook::find_by_id(&pool, 2).await.unwrap() + Logbook::find_by_id(&pool, 3).await.unwrap() ); }