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

10 lines
230 B
SQL

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`entry_beforeDelete`
BEFORE DELETE ON `entry`
FOR EACH ROW
BEGIN
CALL entry_checkBooked(OLD.id);
DELETE FROM buy WHERE entryFk = OLD.id;
END$$
DELIMITER ;