2024-01-15 11:31:03 +00:00
|
|
|
DELIMITER $$
|
2024-01-25 16:33:54 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`saleTracking_afterInsert`
|
2024-01-15 11:31:03 +00:00
|
|
|
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 ;
|