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

17 lines
349 B
MySQL
Raw Permalink Normal View History

DELIMITER $$
2024-08-20 08:06:10 +00:00
CREATE OR REPLACE DEFINER=`vn`@`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 ;