13 lines
302 B
MySQL
13 lines
302 B
MySQL
|
DELIMITER $$
|
||
|
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`business_afterUpdate`
|
||
|
AFTER UPDATE ON `business`
|
||
|
FOR EACH ROW
|
||
|
BEGIN
|
||
|
CALL worker_updateBusiness(NEW.workerFk);
|
||
|
|
||
|
IF NOT (OLD.workerFk <=> NEW.workerFk) THEN
|
||
|
CALL worker_updateBusiness(OLD.workerFk);
|
||
|
END IF;
|
||
|
END$$
|
||
|
DELIMITER ;
|