477 report rewrite, #28020
[freeside.git] / FS / FS / Schema.pm
index ea4e2c2..40248dd 100644 (file)
@@ -4041,7 +4041,7 @@ sub tables_hashref {
       ],
       'primary_key'  => 'prepaynum',
       'unique'       => [ ['identifier'] ],
-      'index'        => [],
+      'index'        => [ ['agentnum'] ],
       'foreign_keys' => [
                           { columns    => [ 'agentnum' ],
                             table      => 'agent',
@@ -4755,6 +4755,18 @@ sub tables_hashref {
                         ],
     },
 
+    'part_pkg_fcc_option' => {
+      'columns' => [
+        'num',        'serial', '', '', '', '',
+        'fccoptionname', 'varchar', '', $char_d, '', '',
+        'pkgpart',       'int', '', '', '', '',
+        'optionvalue',   'varchar', 'NULL', $char_d, '', '',
+      ],
+      'primary_key' => 'num',
+      'unique'      => [ [ 'fccoptionname', 'pkgpart' ] ],
+      'index'       => [],
+    },
+
     'rate' => {
       'columns' => [
         'ratenum',   'serial',     '',      '', '', '', 
@@ -6598,7 +6610,7 @@ sub tables_hashref {
         'exportnum',      'int',     '',      '', '', '',
         '_date',          'int',     '',      '', '', '',
         'status',     'varchar', 'NULL',      32, '', '',
-        'statustext', 'varchar', 'NULL', $char_d, '', '',
+        'statustext',    'text', 'NULL',      '', '', '',
       ],
       'primary_key'  => 'batchnum',
       'unique'       => [],
@@ -6628,13 +6640,23 @@ sub tables_hashref {
                             table      => 'export_batch',
                             references => [ 'batchnum' ]
                           },
-                          { columns    => [ 'svcnum' ],
-                            table      => 'cust_svc',
-                            references => [ 'svcnum' ]
-                          },
                         ],
     },
 
+    # lookup table for states, similar to msa and lata
+    'state' => {
+      'columns' => [
+        'statenum', 'int',  '', '', '', '', 
+        'country',  'char', '',  2, '', '',
+        'state',    'char', '', $char_d, '', '', 
+        'fips',     'char', '',  3, '', '',
+      ],
+      'primary_key' => 'statenum',
+      'unique' => [ [ 'country', 'state' ], ],
+      'index' => [],
+    },
+
+
     # name type nullability length default local
 
     #'new_table' => {