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
Some checks failed
Deploy yourpart (blue-green) / deploy (push) Failing after 2s
This commit is contained in:
@@ -275,7 +275,9 @@ DELETE FROM falukant_data.inventory WHERE id = $1;
|
|||||||
|
|
||||||
pub const QUERY_ADD_SELL_LOG: &str = r#"
|
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)
|
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#"
|
pub const QUERY_GET_ARRIVED_TRANSPORTS: &str = r#"
|
||||||
SELECT
|
SELECT
|
||||||
|
|||||||
Reference in New Issue
Block a user