DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`address_beforeUpdate`
	BEFORE UPDATE ON `address`
	FOR EACH ROW
BEGIN
	
	SET NEW.editorFk = account.myUser_getId();

	IF !(NEW.phone <=> OLD.phone) AND (NEW.phone <> '') THEN
		CALL pbx.phone_isValid(NEW.phone);
	END IF;

    IF !(NEW.mobile <=> OLD.mobile) AND (NEW.mobile <> '')THEN
		CALL pbx.phone_isValid(NEW.mobile);
	END IF;

END$$
DELIMITER ;
