myt/exporters/event.ejs

22 lines
514 B
Plaintext
Executable File

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 ;