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

11 lines
259 B
MySQL
Raw Normal View History

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