From b47031902391248ae7ad90c85c7bf0592ac4f18b Mon Sep 17 00:00:00 2001 From: Irina Peshinskaya Date: Tue, 12 Jun 2018 13:44:42 +0200 Subject: [PATCH] TT#37458 Add AOC preference and billing profile aoc field Change-Id: Ic80e368d334636a936de9ca4960a0a1c3e676217 --- db_scripts/diff/15404.down | 10 ++++++++++ db_scripts/diff/15404.up | 30 ++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 db_scripts/diff/15404.down create mode 100644 db_scripts/diff/15404.up diff --git a/db_scripts/diff/15404.down b/db_scripts/diff/15404.down new file mode 100644 index 00000000..ed33cd08 --- /dev/null +++ b/db_scripts/diff/15404.down @@ -0,0 +1,10 @@ +USE provisioning; +set autocommit=0; + +SELECT id FROM voip_preferences WHERE attribute='advice_of_charge' INTO @aoc_attr_id; + +DELETE FROM voip_preferences_enum where preference_id = @aoc_attr_id; +DELETE FROM voip_preferences where id = @aoc_attr_id; + +ALTER TABLE billing.billing_profiles DROP COLUMN `advice_of_charge`; +commit; \ No newline at end of file diff --git a/db_scripts/diff/15404.up b/db_scripts/diff/15404.up new file mode 100644 index 00000000..3dd44e14 --- /dev/null +++ b/db_scripts/diff/15404.up @@ -0,0 +1,30 @@ +USE provisioning; +set autocommit=0; + +INSERT INTO voip_preferences ( + voip_preference_groups_id, + attribute, label, type, max_occur, + usr_pref, prof_pref, dom_pref, peer_pref, contract_pref, + contract_location_pref, dev_pref, devprof_pref, + modify_timestamp, internal, expose_to_customer, data_type, read_only, + description +) VALUES ( + (SELECT id FROM voip_preference_groups WHERE NAME = 'Internals'), + 'advice_of_charge', 'Advice of charge type', 0, 1, + 1, 0, 1, 0, 1, + 0, 0, 0, + now(), 0, 1, 'enum', 0, + 'Define the way "advice of charge" message will be sent.' +); + +SELECT id FROM voip_preferences WHERE attribute='advice_of_charge' INTO @aoc_attr_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 +(@aoc_attr_id, 'no', NULL, 1, 1, 0, 0, 1, 0, 1), +(@aoc_attr_id, 'Currency', 'currency', 1, 1, 0, 0, 1, 0, 0), +(@aoc_attr_id, 'Pulse', 'pulse', 1, 1, 0, 0, 1, 0, 0); + +ALTER TABLE billing.billing_profiles ADD COLUMN `advice_of_charge` tinyint(1) NOT NULL DEFAULT '0'; +commit; \ No newline at end of file