myt/exporters/event.ejs

20 lines
489 B
Plaintext
Executable File

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