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

17 lines
351 B
MySQL
Raw Normal View History

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`item_afterInsert`
AFTER INSERT ON `item`
FOR EACH ROW
BEGIN
CALL hedera.image_ref('catalog', NEW.image);
INSERT INTO vn.itemTaxCountry(itemFk, countryFk) VALUES
(NEW.id, 1),
(NEW.id, 5);
DELETE ifr.*
FROM edi.item_free ifr
WHERE ifr.id = NEW.id;
END$$
DELIMITER ;