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

11 lines
316 B
SQL

DELIMITER $$
CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`workerMana_beforeUpdate`
BEFORE UPDATE ON `workerMana`
FOR EACH ROW
BEGIN
IF (SELECT EXISTS(SELECT TRUE FROM workerManaExcluded WHERE workerFk = NEW.workerFk)) THEN
CALL util.throw('Worker is excluded from mana');
END IF;
END$$
DELIMITER ;