From 9b4f624e92eff358d843fcc3f89572742a929725 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 22 Dec 2023 19:14:54 +0200 Subject: [PATCH] 1 --- example.sql | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 example.sql diff --git a/example.sql b/example.sql new file mode 100644 index 0000000..09089d6 --- /dev/null +++ b/example.sql @@ -0,0 +1,23 @@ +CREATE DATABASE events_test CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +USE events_test; + +CREATE TABLE `EventsLog` ( + `event_id` int(11) NOT NULL AUTO_INCREMENT, + `event_name` varchar(255) NOT NULL, + `created_at` timestamp NOT NULL DEFAULT current_timestamp(), + `comment` text DEFAULT NULL, + PRIMARY KEY (`event_id`), + KEY `EventsLog_event_name_IDX` (`event_name`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +CREATE EVENT cleanup +ON SCHEDULE EVERY 1 MINUTE +STARTS '2000-1-1 10:00:00.000' +ON COMPLETION PRESERVE ENABLE +DO BEGIN + INSERT INTO events_test.EventsLog(event_name, comment) VALUES ("cleanup", "started"); + + INSERT INTO events_test.EventsLog(event_name, comment) VALUES ("cleanup", "ended"); +END +