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

12 lines
310 B
MySQL
Raw Normal View History

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`buy_beforeDelete`
BEFORE DELETE ON `buy`
FOR EACH ROW
BEGIN
CALL entry_isEditable(OLD.entryFk);
IF OLD.printedStickers <> 0 THEN
CALL util.throw("it is not possible to delete buys with printed labels ");
END IF;
END$$
DELIMITER ;