salix/db/routines/vn/triggers/saleTracking_afterInsert.sql

18 lines
302 B
MySQL
Raw Normal View History

DELIMITER $$
2024-08-20 08:06:10 +00:00
CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`saleTracking_afterInsert`
AFTER INSERT ON `saleTracking`
FOR EACH ROW
BEGIN
IF NEW.isChecked THEN
UPDATE vn.sale s
SET s.isPicked = TRUE
WHERE s.id = NEW.saleFk
AND s.isPicked = 0;
END IF;
END$$
DELIMITER ;