20180524.sql 650 Bytes
use webapm;

DELIMITER $$
CREATE PROCEDURE `p_del_perf`(IN `date_inter` INT)
BEGIN
    DELETE FROM perf_report WHERE (TO_DAYS(NOW()) - TO_DAYS(FROM_UNIXTIME(create_time/1000)))>=date_inter;
END$$
DELIMITER ;

CREATE EVENT `e_del_perf_report`
ON SCHEDULE EVERY 1 DAY STARTS '2018-5-24 0:0:0'
ON COMPLETION PRESERVE DISABLE
DO CALL p_del_perf (7);

alter event e_del_perf_report on completion preserve enable;

ALTER TABLE error_report ADD ip varchar(15);
ALTER TABLE error_report ADD country varchar(100);
ALTER TABLE error_report ADD region varchar(100);
ALTER TABLE error_report ADD city varchar(100);
ALTER TABLE error_report ADD isp varchar(100);