diff --git a/db_scripts/diff/15410.down b/db_scripts/diff/15410.down new file mode 100644 index 00000000..2bfa4c78 --- /dev/null +++ b/db_scripts/diff/15410.down @@ -0,0 +1,12 @@ +USE provisioning; +set autocommit = 0; + +SELECT id INTO @pref_id FROM voip_preferences WHERE attribute='support_auto_answer'; +DELETE FROM voip_preferences_enum WHERE preference_id=@pref_id; +DELETE FROM voip_preferences WHERE id=@pref_id; + +SELECT id INTO @pref_id FROM voip_preferences WHERE attribute='accept_auto_answer'; +DELETE FROM voip_preferences_enum WHERE preference_id=@pref_id; +DELETE FROM voip_preferences WHERE id=@pref_id; + +commit; \ No newline at end of file diff --git a/db_scripts/diff/15410.up b/db_scripts/diff/15410.up new file mode 100644 index 00000000..b2261297 --- /dev/null +++ b/db_scripts/diff/15410.up @@ -0,0 +1,65 @@ +use provisioning; +set autocommit=0; + +insert into voip_preferences + set +voip_preference_groups_id = (select id from voip_preference_groups where name="Internals"), +attribute = "support_auto_answer", +label = "Support Auto-Answer", +type = 0, +max_occur = 1, +usr_pref = 1, +prof_pref = 0, +dom_pref = 1, +peer_pref = 0, +contract_pref = 0, +contract_location_pref = 0, +dev_pref = 0, +devprof_pref = 0, +internal = 0, +expose_to_customer = 0, +data_type = "enum", +read_only = 0, +description = "Provide Auto-Answer header to the called user if the UA provides this header or dials a Vertical Service Code"; + +SELECT last_insert_id() INTO @pref_id; +INSERT INTO voip_preferences_enum +(preference_id, label, value, usr_pref, dom_pref, prof_pref, peer_pref, contract_pref, contract_location_pref, default_val) +VALUES +(@pref_id, 'use domain default', NULL, 1, 0, 0, 0, 0, 0, 1), +(@pref_id, 'No', 'no', 0, 1, 0, 0, 0, 0, 1), +(@pref_id, 'No', 'no', 1, 0, 0, 0, 0, 0, 0), +(@pref_id, 'If provided by phone', 'phone', 1, 1, 0, 0, 0, 0, 0), +(@pref_id, 'If provided by phone or dialed VSC', 'vsc', 1, 1, 0, 0, 0, 0, 0); + +insert into voip_preferences + set +voip_preference_groups_id = (select id from voip_preference_groups where name="Internals"), +attribute = "accept_auto_answer", +label = "Accept Auto-Answer", +type = 0, +max_occur = 1, +usr_pref = 1, +prof_pref = 0, +dom_pref = 1, +peer_pref = 0, +contract_pref = 0, +contract_location_pref = 0, +dev_pref = 0, +devprof_pref = 0, +internal = 0, +expose_to_customer = 1, +data_type = "enum", +read_only = 0, +description = "Provide Auto-Answer header to this subscriber if requested by the remote user agent"; + +SELECT last_insert_id() INTO @pref_id; +INSERT INTO voip_preferences_enum +(preference_id, label, value, usr_pref, dom_pref, prof_pref, peer_pref, contract_pref, contract_location_pref, default_val) +VALUES +(@pref_id, 'use domain default', NULL, 1, 0, 0, 0, 0, 0, 1), +(@pref_id, 'Yes', 'yes', 0, 1, 0, 0, 0, 0, 1), +(@pref_id, 'Yes', 'yes', 1, 0, 0, 0, 0, 0, 0), +(@pref_id, 'No', 'no', 1, 1, 0, 0, 0, 0, 0); + +commit;