2019-02-28 07:55:34 +00:00
|
|
|
DROP TRIGGER IF EXISTS vn2008.ClientesAfterUpdate;
|
|
|
|
USE vn2008;
|
|
|
|
|
|
|
|
DELIMITER $$
|
|
|
|
$$
|
|
|
|
CREATE DEFINER=`root`@`%` TRIGGER `vn2008`.`ClientesAfterUpdate`
|
|
|
|
AFTER UPDATE ON `Clientes`
|
|
|
|
FOR EACH ROW
|
|
|
|
BEGIN
|
|
|
|
IF NEW.default_address AND (NEW.default_address != OLD.default_address) THEN
|
|
|
|
UPDATE Consignatarios SET predeterminada = FALSE
|
|
|
|
WHERE Id_cliente = NEW.Id_cliente;
|
|
|
|
|
2019-03-04 07:13:09 +00:00
|
|
|
|
2019-02-28 07:55:34 +00:00
|
|
|
END IF;
|
|
|
|
END$$
|
|
|
|
DELIMITER ;
|
|
|
|
USE vn;
|