From 8593824a7397afc7a09d232f8bdabd443a4ced78 Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Mon, 13 Apr 2026 15:02:52 +0200 Subject: [PATCH] Enhance sell log SQL query: Updated the `QUERY_ADD_SELL_LOG` to include a `sell_timestamp` field in the conflict resolution clause, ensuring accurate tracking of sell events. This change improves the logging mechanism for sales data in the database. --- src/worker/sql.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/worker/sql.rs b/src/worker/sql.rs index d6c3eb9..294de7d 100644 --- a/src/worker/sql.rs +++ b/src/worker/sql.rs @@ -275,7 +275,9 @@ DELETE FROM falukant_data.inventory WHERE id = $1; pub const QUERY_ADD_SELL_LOG: &str = r#" INSERT INTO falukant_log.sell (region_id, product_id, quantity, seller_id) VALUES ($1, $2, $3, $4) -ON CONFLICT (region_id, product_id, seller_id) DO UPDATE SET quantity = falukant_log.sell.quantity + EXCLUDED.quantity; +ON CONFLICT (region_id, product_id, seller_id) DO UPDATE +SET quantity = falukant_log.sell.quantity + EXCLUDED.quantity, + sell_timestamp = NOW(); "#; pub const QUERY_GET_ARRIVED_TRANSPORTS: &str = r#" SELECT