salix/db/routines/cache/procedures/clean.sql

11 lines
265 B
MySQL
Raw Normal View History

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `cache`.`clean`()
BEGIN
DECLARE vDateShort DATETIME;
SET vDateShort = TIMESTAMPADD(MONTH, -1, util.VN_CURDATE());
DELETE FROM cache.departure_limit WHERE Fecha < vDateShort;
END$$
DELIMITER ;