rewrite CDRs for forwarded Asterisk calls to be billable, RT#3196
[freeside.git] / FS / FS / Schema.pm
index 2cdf41c..d59270b 100644 (file)
@@ -396,7 +396,7 @@ sub tables_hashref {
       'primary_key' => 'eventnum',
       #no... there are retries now #'unique' => [ [ 'eventpart', 'invnum' ] ],
       'unique' => [],
-      'index' => [ ['invnum'], ['status'] ],
+      'index' => [ ['invnum'], ['status'], ['eventpart'] ],
     },
 
     'part_bill_event' => {
@@ -1666,7 +1666,7 @@ sub tables_hashref {
         'vlan_profile', 'varchar', 'NULL', $char_d, '', '', 
       ],
       'primary_key' => 'svcnum',
-      'unique'      => [],
+      'unique'      => [ [ 'mac_addr' ] ],
       'index'       => [],
     },
 
@@ -1787,11 +1787,11 @@ sub tables_hashref {
 
     'rate_prefix' => {
       'columns' => [
-        'prefixnum',   'serial',    '', '', '', '', 
-        'regionnum',   'int',       '', '',, '', '', 
-        'countrycode', 'varchar',     '', 3, '', '', 
-        'npa',         'varchar', 'NULL', 6, '', '', 
-        'nxx',         'varchar', 'NULL', 3, '', '', 
+        'prefixnum',   'serial',      '', '', '', '', 
+        'regionnum',   'int',         '', '', '', '', 
+        'countrycode', 'varchar',     '',  3, '', '', 
+        'npa',         'varchar', 'NULL', 10, '', '', #actually the whole prefix
+        'nxx',         'varchar', 'NULL',  3, '', '', #actually not used
       ],
       'primary_key' => 'prefixnum',
       'unique'      => [],
@@ -2014,12 +2014,15 @@ sub tables_hashref {
         #NULL, done (or something)
         'freesidestatus', 'varchar',   'NULL',     32,   '', '', 
 
+        #NULL, done (or something)
+        'freesiderewritestatus', 'varchar',   'NULL',     32,   '', '', 
+
         'cdrbatch', 'varchar', 'NULL', $char_d, '', '',
 
       ],
       'primary_key' => 'acctid',
       'unique' => [],
-      'index' => [ [ 'calldate' ], [ 'src' ], [ 'dst' ], [ 'charged_party' ], [ 'accountcode' ], [ 'freesidestatus' ], [ 'cdrbatch' ], ],
+      'index' => [ [ 'calldate' ], [ 'src' ], [ 'dst' ], [ 'charged_party' ], [ 'accountcode' ], [ 'freesidestatus' ], [ 'freesiderewritestatus' ], [ 'cdrbatch' ], ],
     },
 
     'cdr_calltype' => {