2024-01-15 11:31:03 +00:00
|
|
|
DELIMITER $$
|
2024-07-22 09:52:42 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`vn-admin`@`localhost` TRIGGER `vn`.`cmr_beforeDelete`
|
2024-01-15 11:31:03 +00:00
|
|
|
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 ;
|