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