deleted trigger from vn.2008expeditions

This commit is contained in:
Gerard 2019-02-01 11:19:26 +01:00
parent 3f08ab1b22
commit 329453ed0d
1 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,13 @@
DROP TRIGGER IF EXISTS vn2008.expeditionsBeforeDelete;
USE vn2008;
DELIMITER $$
$$
CREATE DEFINER=`root`@`%` TRIGGER `vn2008`.`expeditionsBeforeDelete`
BEFORE DELETE ON `expeditions` FOR EACH ROW
BEGIN
UPDATE Tickets SET Bultos = (SELECT COUNT(counter)-1
FROM expeditions WHERE ticket_id = OLD.ticket_id and EsBulto)
WHERE Id_Ticket = OLD.ticket_id;
END$$
DELIMITER ;