mirror of https://github.com/sipwise/db-schema.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.7 KiB
45 lines
1.7 KiB
use provisioning;
|
|
drop trigger if exists voip_pref_urepl_trig;
|
|
DELIMITER ;;
|
|
/*!50003 CREATE*/ /*!50017 DEFINER=`sipwise`@`localhost`*/ /*!50003 TRIGGER voip_pref_urepl_trig AFTER UPDATE ON voip_preferences
|
|
FOR EACH ROW BEGIN
|
|
|
|
IF OLD.attribute != NEW.attribute THEN
|
|
UPDATE kamailio.usr_preferences
|
|
SET attribute = NEW.attribute
|
|
WHERE attribute <=> OLD.attribute;
|
|
UPDATE kamailio.dom_preferences
|
|
SET attribute = NEW.attribute
|
|
WHERE attribute <=> OLD.attribute;
|
|
UPDATE kamailio.peer_preferences
|
|
SET attribute = NEW.attribute
|
|
WHERE attribute <=> OLD.attribute;
|
|
UPDATE kamailio.contract_preferences
|
|
SET attribute = NEW.attribute
|
|
WHERE attribute <=> OLD.attribute;
|
|
UPDATE kamailio.prof_preferences
|
|
SET attribute = NEW.attribute
|
|
WHERE attribute <=> OLD.attribute;
|
|
END IF;
|
|
|
|
END */;;
|
|
DELIMITER ;
|
|
|
|
drop trigger if exists voip_pref_drepl_trig;
|
|
DELIMITER ;;
|
|
/*!50003 CREATE*/ /*!50017 DEFINER=`sipwise`@`localhost`*/ /*!50003 TRIGGER voip_pref_drepl_trig BEFORE DELETE ON voip_preferences
|
|
FOR EACH ROW BEGIN
|
|
|
|
DELETE FROM voip_usr_preferences WHERE attribute_id <=> OLD.id;
|
|
DELETE FROM voip_dom_preferences WHERE attribute_id <=> OLD.id;
|
|
DELETE FROM voip_peer_preferences WHERE attribute_id <=> OLD.id;
|
|
DELETE FROM voip_contract_preferences WHERE attribute_id <=> OLD.id;
|
|
DELETE FROM voip_prof_preferences WHERE attribute_id <=> OLD.id;
|
|
DELETE FROM voip_fielddev_preferences WHERE attribute_id <=> OLD.id;
|
|
DELETE FROM voip_dev_preferences WHERE attribute_id <=> OLD.id;
|
|
DELETE FROM voip_devprof_preferences WHERE attribute_id <=> OLD.id;
|
|
DELETE FROM voip_reseller_preferences WHERE attribute_id <=> OLD.id;
|
|
|
|
END */;;
|
|
DELIMITER ;
|