TT#3668 use accounting.cdr tables for composite primary keys

* this change brings back the accounting.cdr tables
      to use composite primary keys, that is compatible with
      partitioning

Change-Id: I52dc5e665db1a9b9964b52690a7f0792310e1b1b
(cherry picked from commit 0cb5170683)
changes/60/21460/1
Kirill Solomko 8 years ago
parent eb97073646
commit d75c8dec79

@ -0,0 +1,12 @@
set sql_log_bin=0;
use accounting;
ALTER TABLE cdr drop primary key, add index id_stime_idx (id, start_time);
ALTER TABLE cdr_cash_balance_data drop primary key,
add index cdr_id_idx (cdr_id, provider_id, direction_id, cash_balance_id, cdr_start_time);
ALTER TABLE cdr_time_balance_data drop primary key,
add index cdr_id_idx (cdr_id, provider_id, direction_id, time_balance_id, cdr_start_time);
ALTER TABLE cdr_relation_data drop primary key,
add index cdr_id_idx (cdr_id, provider_id, direction_id, relation_id, cdr_start_time);
ALTER TABLE cdr_tag_data drop primary key,
add index cdr_id_idx (cdr_id, provider_id, direction_id, tag_id, cdr_start_time);

@ -0,0 +1,12 @@
set sql_log_bin=0;
use accounting;
ALTER TABLE cdr drop index id_stime_idx, add primary key (id, start_time);
ALTER TABLE cdr_cash_balance_data drop index cdr_id_idx,
add primary key (cdr_id, provider_id, direction_id, cash_balance_id, cdr_start_time);
ALTER TABLE cdr_time_balance_data drop index cdr_id_idx,
add primary key (cdr_id, provider_id, direction_id, time_balance_id, cdr_start_time);
ALTER TABLE cdr_relation_data drop index cdr_id_idx,
add primary key (cdr_id, provider_id, direction_id, relation_id, cdr_start_time);
ALTER TABLE cdr_tag_data drop index cdr_id_idx,
add primary key (cdr_id, provider_id, direction_id, tag_id, cdr_start_time);
Loading…
Cancel
Save