diff --git a/db_scripts/diff/15005.down b/db_scripts/diff/15005.down index f1be74fa..fdaab9dd 100644 --- a/db_scripts/diff/15005.down +++ b/db_scripts/diff/15005.down @@ -1,11 +1,11 @@ -USE billing; - SET AUTOCOMMIT=0; -SELECT id INTO @sip_id FROM billing_mappings WHERE class = 'sipaccount'; +USE billing; + +SELECT id INTO @sip_id FROM products 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'; +SELECT id INTO @pbx_id FROM products WHERE class = 'pbxaccount'; UPDATE billing_mappings SET product_id = NULL WHERE product_id = @pbx_id; DELETE FROM products WHERE class IN ('sipaccount', 'pbxaccount'); @@ -21,16 +21,18 @@ ALTER TABLE voip_subscribers ADD COLUMN autoconf_displayname VARCHAR(255) DEFAULT NULL; -SELECT id INTO @vpg_id FROM voip_preference_groups WHERE name = 'Internal'; +SELECT id INTO @vpg_id FROM voip_preference_groups WHERE name = 'Internals'; 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'); + ('cloud_pbx_hunt_policy', 'cloud_pbx_hunt_timeout', + 'cloud_pbx_hunt_group', 'cloud_pbx_base_cli'); + +DELETE FROM voip_preference_groups WHERE name = 'Cloud PBX'; COMMIT; diff --git a/db_scripts/diff/15005.up b/db_scripts/diff/15005.up index e27cf39c..a5b20410 100644 --- a/db_scripts/diff/15005.up +++ b/db_scripts/diff/15005.up @@ -1,7 +1,7 @@ -USE billing; - SET AUTOCOMMIT=0; +USE billing; + ALTER TABLE products CHANGE COLUMN class class ENUM('sippeering', 'pstnpeering', 'reseller', 'sipaccount', 'pbxaccount') NOT NULL; INSERT INTO products VALUES @@ -52,7 +52,9 @@ VALUES (@vpg_id, 'cloud_pbx_hunt_timeout', 1, 1, 0, 0, 1, 'int', 1, 'The serial timeout for hunting in PBX hunt groups.', '1970-01-01 00:00:00'), (@vpg_id, 'cloud_pbx_hunt_group', 0, 1, 0, 0, - 1, 'string', 0, 'The members (as SIP URIs) of the PBX hunt group.', '1970-01-01 00:00:00'); + 1, 'string', 0, 'The members (as SIP URIs) of the PBX hunt group.', '1970-01-01 00:00:00'), + (@vpg_id, 'cloud_pbx_base_cli', 0, 1, 0, 0, + 1, 'string', 1, 'The base CLI for the PBX extension.', '1970-01-01 00:00:00'); SELECT id INTO @hunt_id FROM voip_preferences WHERE attribute = 'cloud_pbx_hunt_policy'; INSERT INTO voip_preferences_enum