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

13 lines
314 B
MySQL
Raw Normal View History

DELIMITER $$
CREATE OR REPLACE DEFINER=`vn-admin`@`localhost` TRIGGER `vn`.`address_afterInsert`
BEFORE INSERT ON `address`
FOR EACH ROW
BEGIN
IF (SELECT client_hasDifferentCountries(NEW.clientFk)) THEN
UPDATE client
SET hasToInvoiceByAddress = TRUE
WHERE id = NEW.clientFk;
END IF;
END$$
DELIMITER ;