13 lines
308 B
SQL
13 lines
308 B
SQL
DELIMITER $$
|
|
CREATE OR REPLACE DEFINER=`vn`@`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 ;
|