2024-04-17 11:21:27 +00:00
|
|
|
DELIMITER $$
|
2024-08-20 08:06:10 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`travel_recalc`(vSelf INT)
|
2024-04-17 11:21:27 +00:00
|
|
|
proc: BEGIN
|
|
|
|
/**
|
|
|
|
* Updates the number of entries assigned to the travel.
|
|
|
|
*
|
|
|
|
* @param vSelf The travel id
|
|
|
|
*/
|
|
|
|
UPDATE travel
|
|
|
|
SET totalEntries = (
|
|
|
|
SELECT COUNT(id)
|
|
|
|
FROM entry
|
|
|
|
WHERE travelFk = vSelf
|
|
|
|
)
|
|
|
|
WHERE id = vSelf;
|
|
|
|
END$$
|
|
|
|
DELIMITER ;
|