fix contact upgrade for multiple email addresses, #40971, from #25536
[freeside.git] / FS / FS / Schema.pm
index f1c4e08..33fea02 100644 (file)
@@ -1909,6 +1909,8 @@ sub tables_hashref {
         '_date',        @date_type,             '', '', 
         'disabled',         'char', 'NULL',  1, '', '', 
         'usernum',           'int', 'NULL', '', '', '',
+        'close_date',   @date_type,             '', '', 
+        'confidence',        'int', 'NULL', '', '', '',
         #'total',      @money_type,       '', '', 
         #'quotation_term', 'varchar', 'NULL', $char_d, '', '',
       ],
@@ -2256,6 +2258,7 @@ sub tables_hashref {
         'taxname',  'varchar', 'NULL', $char_d, '', '', 
         'setuptax',    'char', 'NULL',       1, '', '', # Y = setup tax exempt
         'recurtax',    'char', 'NULL',       1, '', '', # Y = recur tax exempt
+        'source',   'varchar', 'NULL', $char_d, '', '',
       ],
       'primary_key' => 'taxnum',
       'unique' => [],
@@ -3061,6 +3064,7 @@ sub tables_hashref {
        'paymask', 'varchar', 'NULL', $char_d, '', '', 
         'paybatch',     'varchar',   'NULL', $char_d, '', '', 
         'closed',    'char', 'NULL', 1, '', '', 
+        'source_paynum', 'int', 'NULL', '', '', '', # link to cust_payby, to prevent unapply of gateway-generated refunds
         # credit card/EFT fields (formerly in paybatch)
         'gatewaynum',     'int', 'NULL', '', '', '', # payment_gateway FK
         'processor',  'varchar', 'NULL', $char_d, '', '', # module name
@@ -3083,6 +3087,10 @@ sub tables_hashref {
                           { columns    => [ 'gatewaynum' ],
                             table      => 'payment_gateway',
                           },
+                          { columns    => [ 'source_paynum' ],
+                            table      => 'cust_pay',
+                            references => [ 'paynum' ],
+                          },
                         ],
     },
 
@@ -5516,6 +5524,7 @@ sub tables_hashref {
                    [ 'freesidestatus' ], [ 'freesiderewritestatus' ],
                    [ 'cdrbatch' ], [ 'cdrbatchnum' ],
                    [ 'src_ip_addr' ], [ 'dst_ip_addr' ], [ 'dst_term' ],
+                   [ 'detailnum' ],
                  ],
       #no FKs on cdr table... choosing not to throw errors no matter what's
       # thrown in here.  better to have the data.
@@ -5775,10 +5784,11 @@ sub tables_hashref {
 
     'access_user_log' => {
       'columns'      => [
-        'lognum',  'serial', '',        '', '', '',
-        'usernum',    'int', '',        '', '', '',
-        'path',   'varchar', '', 2*$char_d, '', '',
-        '_date',         @date_type,        '', '',
+        'lognum',          'serial',     '',        '', '', '',
+        'usernum',            'int',     '',        '', '', '',
+        'path',           'varchar',     '', 2*$char_d, '', '',
+        '_date',                   @date_type,          '', '',
+        'render_seconds',     'int', 'NULL',        '', '', '',
       ],
       'primary_key'  => 'lognum',
       'unique'       => [],
@@ -5835,6 +5845,7 @@ sub tables_hashref {
         'pbxsvc',                         'int', 'NULL',      '', '', '',
         'domsvc',                         'int', 'NULL',      '', '', '', 
         'locationnum',                    'int', 'NULL',      '', '', '',
+        'forward_svcnum',                 'int', 'NULL',      '', '', '',
         'forwarddst',                 'varchar', 'NULL',      15, '', '', 
         'email',                      'varchar', 'NULL',     255, '', '', 
         'lnp_status',                 'varchar', 'NULL', $char_d, '', '',