feat: refs #8227 Roadmap changes
gitea/salix/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Guillermo Bonet 2025-01-22 12:40:58 +01:00
parent 482fe77159
commit 052630d268
2 changed files with 12 additions and 0 deletions

View File

@ -5,5 +5,10 @@ CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`roadmapStop_beforeInser
BEGIN
SET NEW.editorFk = account.myUser_getId();
SET NEW.description = UCASE(NEW.description);
IF NEW.roadmapFk IS NOT NULL THEN
IF NEW.eta < (SELECT etd FROM roadmap WHERE id = NEW.roadmapFk) THEN
CALL util.throw('Departure time can not be after arrival time');
END IF;
END IF;
END$$
DELIMITER ;

View File

@ -5,5 +5,12 @@ CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`roadmapStop_beforeUpdat
BEGIN
SET NEW.editorFk = account.myUser_getId();
SET NEW.description = UCASE(NEW.description);
IF (NOT (NEW.roadmapFk <=> OLD.roadmapFk) AND NEW.roadmapFk IS NOT NULL)
OR (NOT (NEW.eta <=> OLD.eta) AND NEW.eta IS NOT NULL) THEN
IF NEW.eta < (SELECT etd FROM roadmap WHERE id = NEW.roadmapFk) THEN
CALL util.throw('Departure time can not be after arrival time');
END IF;
END IF;
END$$
DELIMITER ;