From 5e6e6af8fa881e5943663dadfb4041bd07dd9692 Mon Sep 17 00:00:00 2001 From: silicons <2003111+silicons@users.noreply.github.com> Date: Tue, 10 Dec 2024 19:18:14 -0500 Subject: [PATCH] will that work? --- sql/migrations/V1.0.1__PrepLegacyTables.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sql/migrations/V1.0.1__PrepLegacyTables.sql b/sql/migrations/V1.0.1__PrepLegacyTables.sql index 751737b2d190..f0b9dfa48ec9 100644 --- a/sql/migrations/V1.0.1__PrepLegacyTables.sql +++ b/sql/migrations/V1.0.1__PrepLegacyTables.sql @@ -186,13 +186,13 @@ CREATE TABLE IF NOT EXISTS `rp_playtime_log` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; DELIMITER $$ -CREATE TRIGGER `playtimeTlogupdate` AFTER UPDATE ON `rp_playtime` FOR EACH ROW BEGIN INSERT into `rp_playtime_log` (player, roleid, delta) VALUES (NEW.player, NEW.roleid, NEW.minutes-OLD.minutes); +CREATE TRIGGER IF NOT EXISTS `playtimeTlogupdate` AFTER UPDATE ON `rp_playtime` FOR EACH ROW BEGIN INSERT into `rp_playtime_log` (player, roleid, delta) VALUES (NEW.player, NEW.roleid, NEW.minutes-OLD.minutes); END $$ -CREATE TRIGGER `playtimeTloginsert` AFTER INSERT ON `rp_playtime` FOR EACH ROW BEGIN INSERT into `rp_playtime_log` (player, roleid, delta) VALUES (NEW.player, NEW.roleid, NEW.minutes); +CREATE TRIGGER IF NOT EXISTS `playtimeTloginsert` AFTER INSERT ON `rp_playtime` FOR EACH ROW BEGIN INSERT into `rp_playtime_log` (player, roleid, delta) VALUES (NEW.player, NEW.roleid, NEW.minutes); END $$ -CREATE TRIGGER `playtimeTlogdelete` AFTER DELETE ON `rp_playtime` FOR EACH ROW BEGIN INSERT into `rp_playtime_log` (player, roleid, delta) VALUES (OLD.player, OLD.roleid, 0-OLD.minutes); +CREATE TRIGGER IF NOT EXISTS `playtimeTlogdelete` AFTER DELETE ON `rp_playtime` FOR EACH ROW BEGIN INSERT into `rp_playtime_log` (player, roleid, delta) VALUES (OLD.player, OLD.roleid, 0-OLD.minutes); END $$ DELIMITER ;