2024-04-17 11:21:27 +00:00
|
|
|
DELIMITER $$
|
2024-07-22 09:52:42 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`vn-admin`@`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 ;
|