salix/db/routines/vn/triggers/shelving_beforeUpdate.sql

17 lines
375 B
MySQL
Raw Normal View History

DELIMITER $$
2024-08-20 08:06:10 +00:00
CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`shelving_beforeUpdate`
BEFORE UPDATE ON `shelving`
FOR EACH ROW
BEGIN
SET NEW.editorFk = account.myUser_getId();
IF NEW.code = "" THEN
CALL util.throw('NOT_EMPTY_CODE_ALLOWED');
END IF;
IF NOT(OLD.parkingFk <=> NEW.parkingFK) THEN
SET NEW.isMoving = FALSE;
END IF;
END$$
DELIMITER ;