Merge branch 'dev' into 7584-workerTimeControl_afterDelete
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Robert Ferrús 2025-01-08 06:23:04 +00:00
commit 94ccdabe89
5 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,9 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`workerManaExcluded_beforeInsert`
BEFORE INSERT ON `workerManaExcluded`
FOR EACH ROW
BEGIN
DELETE FROM workerMana
WHERE workerFk = NEW.workerFk;
END$$
DELIMITER ;

View File

@ -0,0 +1,9 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`workerManaExcluded_beforeUpdate`
BEFORE UPDATE ON `workerManaExcluded`
FOR EACH ROW
BEGIN
DELETE FROM workerMana
WHERE workerFk = NEW.workerFk;
END$$
DELIMITER ;

View File

@ -0,0 +1,10 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`workerMana_beforeInsert`
BEFORE INSERT 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 ;

View File

@ -0,0 +1,10 @@
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 ;

View File

@ -0,0 +1,5 @@
DELETE FROM vn.workerMana
WHERE workerFk IN (
SELECT workerFk
FROM vn.workerManaExcluded
);