salix/db/routines/edi/triggers/item_feature_beforeInsert.sql

11 lines
250 B
SQL

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `edi`.`item_feature_beforeInsert`
BEFORE INSERT ON `item_feature`
FOR EACH ROW
BEGIN
IF NEW.expiry_date = '0000-00-00' THEN
SET NEW.expiry_date = NULL;
END IF;
END$$
DELIMITER ;