DROP EVENT IF EXISTS <%- schema %>.<%- name %>; DELIMITER $$ CREATE DEFINER=<%- definer %> EVENT <%- schema %>.<%- name %><% if (locals.type == 'RECURRING') { %> ON SCHEDULE EVERY <%- intervalValue %> <%- intervalField %><% if (locals.starts) { %> STARTS <%- starts %><% } if (locals.ends) { %> ENDS <%- ends %><% } } else { %> ON SCHEDULE AT <%- executeAt %><% } %> ON COMPLETION <%- onCompletion %> <%- status %><% if (locals.comment) { %> COMMENT <%- comment %><% } %> DO <%- body %>$$ DELIMITER ;