Update production log SQL queries to include completion count: Modified the QUERY_INSERT_UPDATE_PRODUCTION_LOG to add a new completion_count field, ensuring accurate tracking of completed productions. Updated related documentation to reflect changes in production counting logic and SQL migrations.
All checks were successful
Deploy yourpart (blue-green) / deploy (push) Successful in 1m51s
All checks were successful
Deploy yourpart (blue-green) / deploy (push) Successful in 1m51s
This commit is contained in:
@@ -1462,11 +1462,13 @@ pub const QUERY_INSERT_UPDATE_PRODUCTION_LOG: &str = r#"
|
||||
product_id,
|
||||
quantity,
|
||||
producer_id,
|
||||
production_date
|
||||
) VALUES ($1, $2, $3, $4, CURRENT_DATE)
|
||||
production_date,
|
||||
completion_count
|
||||
) VALUES ($1, $2, $3, $4, CURRENT_DATE, 1)
|
||||
ON CONFLICT (producer_id, product_id, region_id, production_date)
|
||||
DO UPDATE
|
||||
SET quantity = falukant_log.production.quantity + EXCLUDED.quantity;
|
||||
SET quantity = falukant_log.production.quantity + EXCLUDED.quantity,
|
||||
completion_count = falukant_log.production.completion_count + 1;
|
||||
"#;
|
||||
|
||||
pub const QUERY_ADD_OVERPRODUCTION_NOTIFICATION: &str = r#"
|
||||
|
||||
Reference in New Issue
Block a user