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.
Some checks failed
Deploy yourpart (blue-green) / deploy (push) Failing after 2s

This commit is contained in:
Torsten Schulz (local)
2026-04-13 15:02:52 +02:00
parent 7ca43da52d
commit 8593824a73

View File

@@ -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