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 %><%
|
|
|
|
if (type == 'RECURRING') { %>
|
|
|
|
ON SCHEDULE EVERY <%- intervalValue %> <%- intervalField %><%
|
2022-02-07 10:46:13 +00:00
|
|
|
if (starts) { %>
|
|
|
|
STARTS <%- starts %><%
|
2022-02-07 14:43:12 +00:00
|
|
|
}
|
|
|
|
if (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 %><%
|
|
|
|
if (comment) { %>
|
|
|
|
COMMENT <%- comment %><%
|
|
|
|
} %>
|
2020-11-14 01:38:56 +00:00
|
|
|
DO <%- body %>$$
|
|
|
|
DELIMITER ;
|