Split fee-related columns into source and destination.

Fees applied to the caller for a specific destination go to source_*
(same behavior as before), fees applied to the callee for the same
destination go to destination_*.
remotes/svn/2.8
Andreas Granig 13 years ago
parent c069ddab93
commit b585cdf12f

@ -0,0 +1,37 @@
-- We explicitely don't replicate this statement in order
-- to perform the query only on the corresponding standby
-- node, and we make sure to execute it on both nodes.
-- The reason is that this statement might take quite long
-- and would lock the cdr table on the active node.
USE accounting;
SET AUTOCOMMIT=0;
SET sql_log_bin=0;
ALTER TABLE cdr
CHANGE COLUMN source_carrier_cost carrier_cost decimal(10,2) DEFAULT NULL,
CHANGE COLUMN source_reseller_cost reseller_cost decimal(10,2) DEFAULT NULL,
CHANGE COLUMN source_customer_cost customer_cost decimal(10,2) DEFAULT NULL,
CHANGE COLUMN source_carrier_free_time carrier_free_time int(10) unsigned DEFAULT NULL,
CHANGE COLUMN source_reseller_free_time reseller_free_time int(10) unsigned DEFAULT NULL,
CHANGE COLUMN source_customer_free_time customer_free_time int(10) unsigned DEFAULT NULL,
CHANGE COLUMN source_carrier_billing_fee_id carrier_billing_fee_id int(11) unsigned DEFAULT NULL,
CHANGE COLUMN source_reseller_billing_fee_id reseller_billing_fee_id int(11) unsigned DEFAULT NULL,
CHANGE COLUMN source_customer_billing_fee_id customer_billing_fee_id int(11) unsigned DEFAULT NULL,
CHANGE COLUMN source_carrier_billing_zone_id carrier_billing_zone_id int(11) unsigned DEFAULT NULL,
CHANGE COLUMN source_reseller_billing_zone_id reseller_billing_zone_id int(11) unsigned DEFAULT NULL,
CHANGE COLUMN source_customer_billing_zone_id customer_billing_zone_id int(11) unsigned DEFAULT NULL,
DROP COLUMN destination_carrier_cost,
DROP COLUMN destination_reseller_cost,
DROP COLUMN destination_customer_cost,
DROP COLUMN destination_carrier_free_time,
DROP COLUMN destination_reseller_free_time,
DROP COLUMN destination_customer_free_time,
DROP COLUMN destination_carrier_billing_fee_id,
DROP COLUMN destination_reseller_billing_fee_id,
DROP COLUMN destination_customer_billing_fee_id,
DROP COLUMN destination_carrier_billing_zone_id,
DROP COLUMN destination_reseller_billing_zone_id,
DROP COLUMN destination_customer_billing_zone_id;
COMMIT;

@ -0,0 +1,37 @@
-- We explicitely don't replicate this statement in order
-- to perform the query only on the corresponding standby
-- node, and we make sure to execute it on both nodes.
-- The reason is that this statement might take quite long
-- and would lock the cdr table on the active node.
USE accounting;
SET AUTOCOMMIT=0;
SET sql_log_bin=0;
ALTER TABLE cdr
CHANGE COLUMN carrier_cost source_carrier_cost decimal(10,2) DEFAULT NULL,
CHANGE COLUMN reseller_cost source_reseller_cost decimal(10,2) DEFAULT NULL,
CHANGE COLUMN customer_cost source_customer_cost decimal(10,2) DEFAULT NULL,
CHANGE COLUMN carrier_free_time source_carrier_free_time int(10) unsigned DEFAULT NULL,
CHANGE COLUMN reseller_free_time source_reseller_free_time int(10) unsigned DEFAULT NULL,
CHANGE COLUMN customer_free_time source_customer_free_time int(10) unsigned DEFAULT NULL,
CHANGE COLUMN carrier_billing_fee_id source_carrier_billing_fee_id int(11) unsigned DEFAULT NULL,
CHANGE COLUMN reseller_billing_fee_id source_reseller_billing_fee_id int(11) unsigned DEFAULT NULL,
CHANGE COLUMN customer_billing_fee_id source_customer_billing_fee_id int(11) unsigned DEFAULT NULL,
CHANGE COLUMN carrier_billing_zone_id source_carrier_billing_zone_id int(11) unsigned DEFAULT NULL,
CHANGE COLUMN reseller_billing_zone_id source_reseller_billing_zone_id int(11) unsigned DEFAULT NULL,
CHANGE COLUMN customer_billing_zone_id source_customer_billing_zone_id int(11) unsigned DEFAULT NULL,
ADD COLUMN destination_carrier_cost decimal(10,2) DEFAULT NULL AFTER source_customer_billing_zone_id,
ADD COLUMN destination_reseller_cost decimal(10,2) DEFAULT NULL AFTER destination_carrier_cost,
ADD COLUMN destination_customer_cost decimal(10,2) DEFAULT NULL AFTER destination_reseller_cost,
ADD COLUMN destination_carrier_free_time int(10) unsigned DEFAULT NULL AFTER destination_customer_cost,
ADD COLUMN destination_reseller_free_time int(10) unsigned DEFAULT NULL AFTER destination_carrier_free_time,
ADD COLUMN destination_customer_free_time int(10) unsigned DEFAULT NULL AFTER destination_reseller_free_time,
ADD COLUMN destination_carrier_billing_fee_id int(11) unsigned DEFAULT NULL AFTER destination_customer_free_time,
ADD COLUMN destination_reseller_billing_fee_id int(11) unsigned DEFAULT NULL AFTER destination_carrier_billing_fee_id,
ADD COLUMN destination_customer_billing_fee_id int(11) unsigned DEFAULT NULL AFTER destination_reseller_billing_fee_id,
ADD COLUMN destination_carrier_billing_zone_id int(11) unsigned DEFAULT NULL AFTER destination_customer_billing_fee_id,
ADD COLUMN destination_reseller_billing_zone_id int(11) unsigned DEFAULT NULL AFTER destination_carrier_billing_zone_id,
ADD COLUMN destination_customer_billing_zone_id int(11) unsigned DEFAULT NULL AFTER destination_reseller_billing_zone_id;
COMMIT;
Loading…
Cancel
Save