Created
October 28, 2016 23:08
-
-
Save peijiehu/afed53158abaa390fd8a0b32cd250e17 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SHOW events; | |
DROP EVENT delete_old_posts; | |
CREATE EVENT delete_old_posts | |
ON SCHEDULE EVERY 1 DAY STARTS '2016-10-28 08:00:00' | |
-- !!! no *END*: will continue until you explicitly drop the event | |
DO | |
DELETE FROM article WHERE inserted_at < DATE_SUB(NOW(), INTERVAL 7 DAY); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment