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

11 lines
327 B
MySQL
Raw Permalink Normal View History

DELIMITER $$
2024-08-20 08:06:10 +00:00
CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`cmr_beforeDelete`
BEFORE DELETE ON `cmr`
FOR EACH ROW
BEGIN
IF NOT (OLD.companyFk <=> NULL AND OLD.addressFromFk <=> NULL AND OLD.packagesList <=> NULL) THEN
CALL util.throw("Can not delete cmr, fields required not empty");
END IF;
END$$
DELIMITER ;