improve performance of self-service usage overview with lots of CDRs, RT#73889
[freeside.git] / FS / FS / Schema.pm
index cd8213a..a158f39 100644 (file)
@@ -1210,6 +1210,7 @@ sub tables_hashref {
         'accountcode_cdr', 'char', 'NULL', 1, '', '',
         'billday',   'int', 'NULL', '', '', '',
         'prorate_day',   'int', 'NULL', '', '', '',
+        'force_prorate_day', 'char', 'NULL', 1, '', '',
         'edit_subject', 'char', 'NULL', 1, '', '',
         'locale', 'varchar', 'NULL', 16, '', '', 
         'calling_list_exempt', 'char', 'NULL', 1, '', '',
@@ -2445,11 +2446,12 @@ sub tables_hashref {
         'refnum',   'serial',     '',        '', '', '', 
         'referral', 'varchar',    '',   $char_d, '', '', 
         'disabled', 'char',   'NULL',         1, '', '', 
-        'agentnum', 'int',    'NULL',        '', '', '', 
+        'agentnum', 'int',    'NULL',        '', '', '',
+        'title',   'varchar', 'NULL',   $char_d, '', '', 
       ],
-      'primary_key' => 'refnum',
-      'unique' => [],
-      'index' => [ ['disabled'], ['agentnum'], ],
+      'primary_key'  => 'refnum',
+      'unique'       => [ ['agentnum', 'title'] ],
+      'index'        => [ ['disabled'], ['agentnum'], ],
     },
 
     'part_svc' => {
@@ -3909,6 +3911,7 @@ sub tables_hashref {
       'unique' => [],
       'index' => [ [ 'calldate' ],
                    [ 'src' ], [ 'dst' ], [ 'dcontext' ], [ 'charged_party' ],
+                   [ 'startdate' ],
                    [ 'lastapp' ],
                    ['accountcode'], ['uniqueid'], ['carrierid'], ['cdrid'],
                    [ 'sessionnum' ], [ 'subscriber' ],