2021-10-22 14:11:03 +00:00
|
|
|
DROP EVENT IF EXISTS <%- schema %>.<%- name %>;
|
2020-11-14 01:38:56 +00:00
|
|
|
DELIMITER $$
|
2022-02-07 14:43:12 +00:00
|
|
|
CREATE DEFINER=<%- definer %> EVENT <%- schema %>.<%- name %><%
|
2022-12-29 13:27:16 +00:00
|
|
|
if (locals.type == 'RECURRING') { %>
|
2022-02-07 14:43:12 +00:00
|
|
|
ON SCHEDULE EVERY <%- intervalValue %> <%- intervalField %><%
|
2022-12-29 13:27:16 +00:00
|
|
|
if (locals.starts) { %>
|
2022-02-07 10:46:13 +00:00
|
|
|
STARTS <%- starts %><%
|
2022-02-07 14:43:12 +00:00
|
|
|
}
|
2022-12-29 13:27:16 +00:00
|
|
|
if (locals.ends) { %>
|
2022-02-07 10:46:13 +00:00
|
|
|
ENDS <%- ends %><%
|
2022-02-07 14:43:12 +00:00
|
|
|
}
|
|
|
|
} else { %>
|
|
|
|
ON SCHEDULE AT <%- executeAt %><%
|
2022-02-07 10:46:13 +00:00
|
|
|
} %>
|
2020-11-14 01:38:56 +00:00
|
|
|
ON COMPLETION <%- onCompletion %>
|
2022-02-07 14:43:12 +00:00
|
|
|
<%- status %><%
|
2022-12-29 13:27:16 +00:00
|
|
|
if (locals.comment) { %>
|
2022-02-07 14:43:12 +00:00
|
|
|
COMMENT <%- comment %><%
|
|
|
|
} %>
|
2020-11-14 01:38:56 +00:00
|
|
|
DO <%- body %>$$
|
|
|
|
DELIMITER ;
|