--
-- ON stock_ledger INSERT: SET part.balance = stock_ledger.balance
--
DROP TRIGGER IF EXISTS `tbmsdb`.`stock_ledger_AFTER_INSERT`;

DELIMITER $$
USE `tbmsdb`$$
CREATE DEFINER = `root`@`localhost` TRIGGER `tbmsdb`.`stock_ledger_AFTER_INSERT` AFTER INSERT ON `stock_ledger` FOR EACH ROW
BEGIN
	UPDATE `part` SET `balance` = NEW.`balance` WHERE `id` = NEW.`partId`;
END$$
DELIMITER ;
