fix certain problems with third-party payment, #23579
[freeside.git] / FS / FS / Schema.pm
index a9fc13d..49e8bd7 100644 (file)
@@ -466,7 +466,7 @@ sub tables_hashref {
   my $char_d = 80; #default maxlength for text fields
 
   #my(@date_type)  = ( 'timestamp', '', ''     );
-  my @date_type  = ( 'int', 'NULL', ''     );
+  my @date_type = ( 'int', 'NULL', ''     );
   my @perl_type = ( 'text', 'NULL', ''  ); 
   my @money_type = ( 'decimal',   '', '10,2' );
   my @money_typen = ( 'decimal',   'NULL', '10,2' );
@@ -1521,8 +1521,10 @@ sub tables_hashref {
         'stateid_state', 'varchar', 'NULL', $char_d, '', '', 
         'national_id', 'varchar', 'NULL', $char_d, '', '',
         'birthdate' ,@date_type, '', '', 
-        'spouse_birthdate' ,@date_type, '', '', 
-        'anniversary_date' ,@date_type, '', '', 
+        'spouse_last',  'varchar', 'NULL', 2*$char_d, '', '',
+        'spouse_first', 'varchar', 'NULL', $char_d, '', '',
+        'spouse_birthdate', @date_type, '', '', 
+        'anniversary_date', @date_type, '', '', 
         'signupdate',@date_type, '', '', 
         'dundate',   @date_type, '', '', 
         'company',  'varchar', 'NULL', $char_d, '', '', 
@@ -2230,7 +2232,7 @@ sub tables_hashref {
 
         'pkgnum', 'int', 'NULL', '', '', '', #desired pkgnum for pkg-balances
         'status',       'varchar',     '', $char_d, '', '', 
-        'session_id',   'varchar', 'NULL', $char_d, '', '', #only need 32
+        'session_id',   'varchar', 'NULL', 1024, '', '', # SHA-512-hex
         'statustext',   'text',    'NULL',  '', '', '', 
         'gatewaynum',   'int',     'NULL',  '', '', '',
         #'cust_balance', @money_type,            '', '',
@@ -2571,7 +2573,7 @@ sub tables_hashref {
         'manual_flag',        'char', 'NULL',  1, '', '', 
         'no_auto',            'char', 'NULL',  1, '', '', 
         'quantity',            'int', 'NULL', '', '', '',
-        'agent_pkgid',         'int', 'NULL', '', '', '',
+        'agent_pkgid',     'varchar', 'NULL', $char_d, '', '',
         'waive_setup',        'char', 'NULL',  1, '', '', 
         'recur_show_zero',    'char', 'NULL',  1, '', '',
         'setup_show_zero',    'char', 'NULL',  1, '', '',
@@ -2853,7 +2855,8 @@ sub tables_hashref {
         'currency',       'char', 'NULL',       3, '', '',
         'otaker',       'varchar',   'NULL',   32, '', '', 
         'usernum',   'int', 'NULL', '', '', '',
-        'reason',       'varchar',   '',   $char_d, '', '', 
+        'reason',       'varchar',   'NULL',   $char_d, '', '', 
+        'reasonnum',   'int', 'NULL', '', '', '',
         'payby',        'char',   '',     4, '', '', # CARD/BILL/COMP, should
                                                      # be index into payby
                                                      # table eventually
@@ -2877,6 +2880,9 @@ sub tables_hashref {
                           { columns    => [ 'usernum' ],
                             table      => 'access_user',
                           },
+                          { columns    => [ 'reasonnum' ],
+                            table      => 'reason',
+                          },
                           { columns    => [ 'gatewaynum' ],
                             table      => 'payment_gateway',
                           },
@@ -5043,11 +5049,12 @@ sub tables_hashref {
 
     'pkg_category' => {
       'columns' => [
-        'categorynum',   'serial',  '', '', '', '', 
-        'categoryname',  'varchar', '', $char_d, '', '', 
-        'weight',         'int', 'NULL',  '', '', '',
-        'condense',      'char', 'NULL',   1, '', '', 
-        'disabled',      'char', 'NULL',   1, '', '', 
+        'categorynum',        'serial',     '',      '', '', '', 
+        'categoryname',      'varchar',     '', $char_d, '', '', 
+        'weight',                'int', 'NULL',      '', '', '',
+        'ticketing_queueid',     'int', 'NULL',      '', '', '', 
+        'condense',             'char', 'NULL',       1, '', '', 
+        'disabled',             'char', 'NULL',       1, '', '', 
       ],
       'primary_key' => 'categorynum',
       'unique' => [],
@@ -5473,6 +5480,44 @@ sub tables_hashref {
       'index'  => [],
     },
 
+    'sched_item' => {
+      'columns' => [
+        'itemnum',   'serial',      '', '', '', '', 
+        'usernum',      'int',  'NULL', '', '', '', 
+        #'itemname', 'varchar', $char_d, '', '', '',
+        'disabled',    'char',  'NULL',  1, '', '', 
+      ],
+      'primary_key'  => 'itemnum',
+      'unique'       => [ [ 'usernum' ] ],
+      'index'        => [],
+      'foreign_keys' => [
+                          { columns    => [ 'usernum' ],
+                            table      => 'access_user',
+                          },
+                        ],
+    },
+
+    #'sched_item_class'
+
+    'sched_avail' => {
+      'columns' => [
+        'availnum',      'serial', '', '', '', '', 
+        'itemnum',          'int', '', '', '', '',
+        'wday',             'int', '', '', '', '',
+        'stime',            'int', '', '', '', '',
+        'etime',            'int', '', '', '', '',
+        'override_date',    @date_type,    '', '',
+      ],
+      'primary_key'  => 'availnum',
+      'unique'       => [],
+      'index'        => [],
+      'foreign_keys' => [
+                          { columns    => [ 'itemnum' ],
+                            table      => 'sched_item',
+                          },
+                        ],
+    },
+
     'svc_phone' => {
       'columns' => [
         'svcnum',                         'int',     '',      '', '', '',