USE provisioning;

-- fix broken trigger "enum_update"

DROP TRIGGER enum_update;

DELIMITER |

CREATE TRIGGER enum_update AFTER UPDATE ON voip_preferences_enum
FOR EACH ROW BEGIN
    UPDATE voip_usr_preferences SET value=NEW.value
    WHERE attribute_id=NEW.preference_id;
    UPDATE voip_dom_preferences SET value=NEW.value
    WHERE attribute_id=NEW.preference_id;
    UPDATE voip_peer_preferences SET value=NEW.value
    WHERE attribute_id=NEW.preference_id;
END |

DELIMITER ;
