I have two versions of the same DB. The original has code for triggers. The second is a copy of the original without the triggers.
With the original DB, the application fails to post data on submit, but data seems to post correctly to the copy.
Here's the trigger code:
DROP TRIGGER IF EXISTS `uat`.`updateConditionCCRDataObjectID`;
CREATE TRIGGER `uat`.`updateConditionCCRDataObjectID` BEFORE INSERT ON `uat`.`condition_details`
FOR EACH ROW BEGIN
IF NEW.CCRDataObjectID = NULL OR NEW.CCRDataObjectID = '' THEN
SELECT coalesce(MAX(id)+1,1) into @IDVal from condition_details;
SET NEW.CCRDataObjectID = CONCAT('Comp-Condition-',@IDVal);
Could someone explain what the trigger does and perhaps an opinion on whether it's necessary?
Thanks - Steve