fix date checks on stored procedures
authorAlan <alan@roojs.com>
Wed, 1 Nov 2023 00:57:41 +0000 (08:57 +0800)
committerAlan <alan@roojs.com>
Wed, 1 Nov 2023 00:57:41 +0000 (08:57 +0800)
mysql/core_notify_trigger_after_delete.sql
mysql/core_notify_trigger_after_update.sql

index 81de637..7d714f4 100644 (file)
@@ -10,7 +10,7 @@ CREATE TRIGGER core_notify_trigger_after_delete AFTER DELETE on core_notify
     FOR EACH ROW
         BEGIN
             -- I think we changed it so that sent is not null, deafult '0000....'
     FOR EACH ROW
         BEGIN
             -- I think we changed it so that sent is not null, deafult '0000....'
-            if old.sent is not null AND old.sent > '0001-01-01 00:00:00' THEN 
+            if old.sent is not null AND old.sent > '1500-01-01 00:00:00' THEN 
                 UPDATE `Error: Can not delete core_notify after it is sent` SET x = 1;
             END IF;
         END;
                 UPDATE `Error: Can not delete core_notify after it is sent` SET x = 1;
             END IF;
         END;
index 4f5bfba..07bdc83 100644 (file)
@@ -10,7 +10,7 @@ CREATE TRIGGER core_notify_trigger_after_update
         FOR EACH ROW
         BEGIN
             -- make sure that act_start does not get modified if sent is set.
         FOR EACH ROW
         BEGIN
             -- make sure that act_start does not get modified if sent is set.
-            IF (OLD.sent IS NOT NULL AND  OLD.sent > '1500-00-00 00:00:00')
+            IF (OLD.sent IS NOT NULL AND  OLD.sent > '1500-01-01 00:00:00')
                 AND  ( NEW.act_start != OLD.act_start  OR NEW.act_when != OLD.act_when )  THEN
                   UPDATE `Error: Can not update core_notify action dates  after its sent` SET x = 1;
             END IF;
                 AND  ( NEW.act_start != OLD.act_start  OR NEW.act_when != OLD.act_when )  THEN
                   UPDATE `Error: Can not update core_notify action dates  after its sent` SET x = 1;
             END IF;