google authenticator support, RT#86743
[freeside.git] / FS / FS / Schema.pm
index 5a604bc..f1eb2b2 100644 (file)
@@ -1664,6 +1664,7 @@ sub tables_hashref {
         'invoice_attn', 'varchar', 'NULL', $char_d, '', '',
         'invoice_ship_address', 'char', 'NULL', 1, '', '',
         'postal_invoice', 'char', 'NULL', 1, '', '',
+        'paymentreceipt_noemail', 'char', 'NULL', 1, '', '',
       ],
       'primary_key'  => 'custnum',
       'unique'       => [ [ 'agentnum', 'agent_custid' ] ],
@@ -1764,7 +1765,8 @@ sub tables_hashref {
         'classnum',              'int', 'NULL',  '', '', '',
         'comment',           'varchar', 'NULL', 255, '', '',
         'selfservice_access',   'char', 'NULL',   1, '', '',
-        'invoice_dest',         'char', 'NULL',       1, '', '',
+        'invoice_dest',         'char', 'NULL',   1, '', '', # Y or NULL
+        'message_dest',         'char', 'NULL',   1, '', '', # Y or NULL
       ],
       'primary_key'  => 'custcontactnum',
       'unique'       => [ [ 'custnum', 'contactnum' ], ],
@@ -2287,6 +2289,7 @@ sub tables_hashref {
         'setuptax',    'char', 'NULL',       1, '', '', # Y = setup tax exempt
         'recurtax',    'char', 'NULL',       1, '', '', # Y = recur tax exempt
         'source',   'varchar', 'NULL', $char_d, '', '',
+        'charge_prediscount', 'char', 'NULL', 1, '', '', # Y = charge this tax pre discount
       ],
       'primary_key' => 'taxnum',
       'unique' => [],
@@ -2679,6 +2682,7 @@ sub tables_hashref {
         'upload',         @date_type,     '', '', 
         'title',   'varchar', 'NULL',255, '', '',
         'processor_id',   'varchar', 'NULL',255, '', '',
+        'type',      'char',  '',  6, 'DEBIT', '', # DEBIT/CREDIT
       ],
       'primary_key'  => 'batchnum',
       'unique'       => [],
@@ -2719,7 +2723,7 @@ sub tables_hashref {
       ],
       'primary_key'  => 'paybatchnum',
       'unique'       => [],
-      'index'        => [ ['batchnum'], ['invnum'], ['custnum'] ],
+      'index'        => [ ['batchnum'], ['invnum'], ['custnum'],['status'] ],
       'foreign_keys' => [
                           { columns    => [ 'batchnum' ],
                             table      => 'pay_batch',
@@ -4133,7 +4137,7 @@ sub tables_hashref {
         'note',     'text',    'NULL',      '', '', '',
       ],
       'primary_key'  => 'svcnum',
-      'unique'       => [],
+      'unique'       => [ ['typenum', 'serial'], ['ip_addr'], ['hw_addr'] ],
       'index'        => [],
       'foreign_keys' => [
                           { columns    => [ 'svcnum' ],
@@ -5129,13 +5133,14 @@ sub tables_hashref {
 
     'rate' => {
       'columns' => [
-        'ratenum',          'serial',     '', '', '', '', 
-        'ratename',        'varchar', '',$char_d, '', '', 
-        'agentnum',            'int', 'NULL', '', '', '',
-        'default_detailnum',   'int', 'NULL', '', '', '',
+        'ratenum',          'serial',     '',      '', '', '', 
+        'ratename',        'varchar',     '', $char_d, '', '', 
+        'agentnum',            'int', 'NULL',      '', '', '',
+        'default_detailnum',   'int', 'NULL',      '', '', '',
+        'agent_rateid',    'varchar', 'NULL', $char_d, '', '',
       ],
       'primary_key' => 'ratenum',
-      'unique'      => [],
+      'unique'      => [ ['agentnum','agent_rateid'], ],
       'index'       => [],
       'foreign_keys' => [
                           { columns    => [ 'agentnum' ],
@@ -5198,10 +5203,11 @@ sub tables_hashref {
         'regionnum',   'serial',      '', '', '', '', 
         'regionname',  'varchar',     '', $char_d, '', '', 
         'exact_match', 'char',    'NULL',  1, '', '',
+        'agent_regionid',    'varchar', 'NULL', $char_d, '', '',
       ],
       'primary_key' => 'regionnum',
       'unique'      => [],
-      'index'       => [],
+      'index'       => [ ['agent_regionid'] ],
     },
 
     'rate_prefix' => {
@@ -5596,6 +5602,9 @@ sub tables_hashref {
         #NULL, done (or something)
         'freesidestatus', 'varchar',   'NULL',     32,   '', '', 
 
+        #additional status info (i.e. reason for "skipped" freesidestatus)
+        'freesidestatustext', 'text',  'NULL',     '',   '', '',
+
         #NULL, done (or something)
         'freesiderewritestatus', 'varchar',   'NULL',     32,   '', '', 
 
@@ -5614,6 +5623,9 @@ sub tables_hashref {
         # FK to cust_bill_pkg_detail; having a value here absolutely means
         # that the CDR appears on an invoice
         'detailnum',     'bigint',    'NULL',      '', '', '',
+
+        #for mediation/deduplication
+        'sipcallid',    'varchar',    'NULL',     255, '', '',
       ],
       'primary_key' => 'acctid',
       'unique' => [],
@@ -5627,7 +5639,7 @@ sub tables_hashref {
                    [ 'freesidestatus' ], [ 'freesiderewritestatus' ],
                    [ 'cdrbatch' ], [ 'cdrbatchnum' ],
                    [ 'src_ip_addr' ], [ 'dst_ip_addr' ], [ 'dst_term' ],
-                   [ 'detailnum' ],
+                   [ 'detailnum' ], [ 'sipcallid' ],
                  ],
       #no FKs on cdr table... choosing not to throw errors no matter what's
       # thrown in here.  better to have the data.
@@ -5806,6 +5818,7 @@ sub tables_hashref {
         'username',           'varchar',     '', $char_d, '', '',
         '_password',          'varchar', 'NULL', $char_d, '', '',
         '_password_encoding', 'varchar', 'NULL', $char_d, '', '',
+        'totp_secret32',         'char', 'NULL',      32, '', '',
         'last',               'varchar', 'NULL', $char_d, '', '', 
         'first',              'varchar', 'NULL', $char_d, '', '', 
         'user_custnum',           'int', 'NULL',      '', '', '',
@@ -6843,7 +6856,7 @@ sub tables_hashref {
         'mac_addr',  'varchar', 'NULL',      12, '', '', 
       ],
       'primary_key'  => 'svcnum',
-      'unique'       => [ ['serialnum'] , ['mac_addr'] ],
+      'unique'       => [ ['modelnum', 'serialnum'] , ['mac_addr'] ],
       'index'        => [],
       'foreign_keys' => [
                           { columns    => [ 'svcnum' ],
@@ -7325,6 +7338,7 @@ sub tables_hashref {
         'is_business',    'char',    'NULL', 1,       '', '',
         'active_date',    @date_type,                 '', '',
         'expire_date',    @date_type,                 '', '',
+        'disabled',       'char',    'NULL',       1, '', '',
       ],
       'primary_key' => 'zonenum',
       'unique' => [],
@@ -7540,6 +7554,22 @@ sub tables_hashref {
                          ],
     },
 
+    'svc_group' => {
+      'columns' => [
+        'svcnum',          'int', '', '', '', '', 
+        'max_accounts',    'int', '', '', '', '',
+      ],
+      'primary_key'  => 'svcnum',
+      'unique'       => [],
+      'index'        => [],
+      'foreign_keys' => [
+                          { columns    => [ 'svcnum' ],
+                            table      => 'cust_svc',
+                          },
+                        ],
+    },
+
+
     # name type nullability length default local
 
     #'new_table' => {