11 lines
297 B
SQL
11 lines
297 B
SQL
DELIMITER $$
|
|
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`workerIncome_afterUpdate`
|
|
AFTER UPDATE ON `workerIncome`
|
|
FOR EACH ROW
|
|
BEGIN
|
|
CALL worker_updateBalance(NEW.workerFk,-OLD.credit,-OLD.debit);
|
|
|
|
CALL worker_updateBalance(NEW.workerFk,NEW.credit,NEW.debit);
|
|
END$$
|
|
DELIMITER ;
|