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.
db-schema/db_scripts/diff/15005.down

37 lines
1.2 KiB

USE billing;
SET AUTOCOMMIT=0;
SELECT id INTO @sip_id FROM billing_mappings WHERE class = 'sipaccount';
UPDATE billing_mappings SET product_id = NULL WHERE product_id = @sip_id;
SELECT id INTO @pbx_id FROM billing_mappings WHERE class = 'pbxaccount';
UPDATE billing_mappings SET product_id = NULL WHERE product_id = @pbx_id;
DELETE FROM products WHERE class IN ('sipaccount', 'pbxaccount');
USE provisioning;
DROP TABLE voip_pbx_groups;
ALTER TABLE voip_subscribers
DROP COLUMN is_pbx_group;
ALTER TABLE voip_subscribers
CHANGE COLUMN pbx_group_id autoconf_group_id INT(11) UNSIGNED DEFAULT NULL;
ALTER TABLE voip_subscribers
ADD COLUMN autoconf_displayname VARCHAR(255) DEFAULT NULL;
SELECT id INTO @vpg_id FROM voip_preference_groups WHERE name = 'Internal';
UPDATE voip_preferences SET
voip_preference_groups_id = @vpg_id,
internal = 0
WHERE attribute = 'cloud_pbx';
DELETE FROM voip_preference_groups WHERE name = 'Cloud PBX';
SELECT id INTO @hunt_id FROM voip_preferences WHERE attribute = 'cloud_pbx_hunt_policy';
DELETE FROM voip_preferences_enum WHERE preference_id = @hunt_id;
DELETE FROM voip_preferences WHERE attribute IN
('cloud_pbx_hunt_policy', 'cloud_pbx_hunt_timeout', 'cloud_pbx_hunt_group');
COMMIT;