#9694 update structure db
This commit is contained in:
parent
19d8a2c98c
commit
e5f91079c8
|
@ -0,0 +1,13 @@
|
||||||
|
DROP TRIGGER IF EXISTS `vn2008`.`expeditionsBeforeDelete`;
|
||||||
|
|
||||||
|
DELIMITER $$
|
||||||
|
USE `vn2008`$$
|
||||||
|
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 ;
|
Loading…
Reference in New Issue