Enhance SQL insert query for sell logs and improve error logging in TransportWorker: Add sell_timestamp to the insert statement and refine error messages to include transport details for better debugging.
This commit is contained in:
@@ -206,8 +206,12 @@ 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;
|
||||
INSERT INTO falukant_log.sell (region_id, product_id, quantity, seller_id, sell_timestamp)
|
||||
VALUES ($1, $2, $3, $4, NOW())
|
||||
ON CONFLICT (region_id, product_id, seller_id)
|
||||
DO UPDATE SET
|
||||
quantity = falukant_log.sell.quantity + EXCLUDED.quantity,
|
||||
sell_timestamp = COALESCE(EXCLUDED.sell_timestamp, NOW());
|
||||
"#;
|
||||
pub const QUERY_GET_ARRIVED_TRANSPORTS: &str = r#"
|
||||
SELECT
|
||||
|
||||
Reference in New Issue
Block a user