mysql/core_notify_trigger_after_delete.sql
authorAlan Knowles <alan@roojs.com>
Wed, 24 Oct 2018 06:35:41 +0000 (14:35 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 24 Oct 2018 06:35:41 +0000 (14:35 +0800)
mysql/core_notify_trigger_after_delete.sql

index 400a4e4..59faadc 100644 (file)
@@ -9,7 +9,7 @@ DELIMITER $$
 CREATE TRIGGER core_notify_trigger_after_delete AFTER DELETE on core_notify
     FOR EACH ROW
         BEGIN
-            if old.sent is not null THEN 
+            if old.sent is not null AND old.sent > '0001-01-01 00:00:00' THEN 
                 UPDATE `Error: Can not delete core_notify after it is sent` SET x = 1;
             END IF;
         END;