salix/services/db/install/changes/1.2-CHECK/02-beforeInsertItemLog.sql

12 lines
288 B
MySQL
Raw Normal View History

2018-10-29 10:35:17 +00:00
DROP TRIGGER IF EXISTS `vn`.`itemLog_BEFORE_INSERT`;
DELIMITER $$
USE `vn`$$
CREATE DEFINER=`root`@`%` TRIGGER `vn`.`itemLog_BEFORE_INSERT` BEFORE INSERT ON `itemLog` FOR EACH ROW
BEGIN
IF NEW.newInstance is NULL THEN
SET NEW.newInstance = NEW.description;
END IF;
END$$
DELIMITER ;