salix/services/db/install/changes/1.2-CHECK/03-clientLogBeforeInsert.sql

12 lines
294 B
SQL

DROP TRIGGER IF EXISTS `vn`.`clientLog_BEFORE_INSERT`;
DELIMITER $$
USE `vn`$$
CREATE DEFINER=`root`@`%` TRIGGER `vn`.`clientLog_BEFORE_INSERT` BEFORE INSERT ON `clientLog` FOR EACH ROW
BEGIN
IF NEW.newInstance is NULL THEN
SET NEW.newInstance = NEW.description;
END IF;
END$$
DELIMITER ;