per address block ip auto assignment and auto router selection
[freeside.git] / FS / FS / Schema.pm
index 3bcd078..0b121db 100644 (file)
@@ -200,6 +200,14 @@ sub dbdef_dist {
                                                      ],
                                       });
 
+    $h_indices{"h_${table}_srckey2"} = DBIx::DBSchema::Index->new({
+                                         'name'    => "h_${table}_srckey2",
+                                         'unique'  => 0,
+                                         'columns' => [ 'history_date',
+                                                        $tableobj->primary_key,
+                                                      ],
+                                       });
+
     my $h_tableobj = DBIx::DBSchema::Table->new( {
       'name'          => "h_$table",
       'primary_key'   => 'historynum',
@@ -500,8 +508,6 @@ sub tables_hashref {
         'quantity',  'int', 'NULL', '', '', '',
         'unitsetup', @money_typen, '', '', 
         'unitrecur', @money_typen, '', '', 
-        'duplicate',  'char', 'NULL', 1, '', '',
-        'post_total', 'char', 'NULL', 1, '', '',
       ],
       'primary_key' => 'billpkgnum',
       'unique' => [],
@@ -514,12 +520,30 @@ sub tables_hashref {
         'billpkgnum', 'int', 'NULL', '', '', '',        # should not be nullable
         'pkgnum',  'int', 'NULL', '', '', '',           # deprecated
         'invnum',  'int', 'NULL', '', '', '',           # deprecated
+        'amount',  @money_typen, '', '', 
         'format',  'char', 'NULL', 1, '', '',
+        'classnum', 'char', 'NULL', 1, '', '',
         'detail',  'varchar', '', $char_d, '', '', 
       ],
       'primary_key' => 'detailnum',
       'unique' => [],
-      'index' => [ [ 'billpkgnum' ], [ 'pkgnum', 'invnum' ] ],
+      'index' => [ [ 'billpkgnum' ], [ 'classnum' ], [ 'pkgnum', 'invnum' ] ],
+    },
+
+    'cust_bill_pkg_display' => {
+      'columns' => [
+        'billpkgdisplaynum', 'serial', '', '', '', '', 
+        'billpkgnum', 'int', '', '', '', '', 
+        'section',  'varchar', 'NULL', $char_d, '', '', 
+        #'unitsetup', @money_typen, '', '',     #override the linked real one?
+        #'unitrecur', @money_typen, '', '',     #this too?
+        'post_total', 'char', 'NULL', 1, '', '',
+        'type',       'char', 'NULL', 1, '', '',
+        'summary',    'char', 'NULL', 1, '', '',
+      ],
+      'primary_key' => 'billpkgdisplaynum',
+      'unique' => [],
+      'index' => [ ['billpkgnum'], ],
     },
 
     'cust_credit' => {
@@ -581,6 +605,7 @@ sub tables_hashref {
         'stateid_state', 'varchar', 'NULL', $char_d, '', '', 
         'birthdate' ,@date_type, '', '', 
         'signupdate',@date_type, '', '', 
+        'dundate',   @date_type, '', '', 
         'company',  'varchar', 'NULL', $char_d, '', '', 
         'address1', 'varchar', '',     $char_d, '', '', 
         'address2', 'varchar', 'NULL', $char_d, '', '', 
@@ -942,6 +967,19 @@ sub tables_hashref {
       'index'       => [ [ 'pkgnum' ], [ 'optionname' ] ],
     },
 
+    'cust_pkg_detail' => {
+      'columns' => [
+        'pkgdetailnum', 'serial', '',      '', '', '',
+        'pkgnum',          'int', '',      '', '', '',
+        'detail',      'varchar', '', $char_d, '', '', 
+        'detailtype',     'char', '',       1, '', '', # "I"nvoice or "C"omment
+        'weight',          'int', '',      '', '', '',
+      ],
+      'primary_key' => 'pkgdetailnum',
+      'unique' => [],
+      'index'  => [ [ 'pkgnum', 'detailtype' ] ],
+    },
+
     'cust_pkg_reason' => {
       'columns' => [
         'num',      'serial',    '',   '', '', '', 
@@ -953,7 +991,7 @@ sub tables_hashref {
       ],
       'primary_key' => 'num',
       'unique' => [],
-      'index' => [],
+      'index' => [ [ 'pkgnum' ], [ 'reasonnum' ], ['action'], ],
     },
 
     'cust_refund' => {
@@ -1103,6 +1141,7 @@ sub tables_hashref {
         'taxoverridenum', 'serial', '', '', '', '',
         'pkgpart',        'serial', '', '', '', '',
         'taxclassnum',    'serial', '', '', '', '',
+        'usage_class',    'varchar', 'NULL', $char_d, '', '', 
       ],
       'primary_key' => 'taxoverridenum',
       'unique' => [],
@@ -1547,6 +1586,7 @@ sub tables_hashref {
         'ip_gateway', 'varchar', '', 15, '', '', 
         'ip_netmask', 'int', '', '', '', '', 
         'agentnum',   'int', 'NULL', '', '', '', 
+        'manual_flag', 'char', 'NULL', 1, '', '', 
       ],
       'primary_key' => 'blocknum',
       'unique'      => [ [ 'blocknum', 'routernum' ] ],
@@ -1917,10 +1957,12 @@ sub tables_hashref {
         #NULL, done (or something)
         'freesidestatus', 'varchar',   'NULL',     32,   '', '', 
 
+        'cdrbatch', 'varchar', 'NULL', $char_d, '', '',
+
       ],
       'primary_key' => 'acctid',
       'unique' => [],
-      'index' => [ [ 'calldate' ], [ 'dst' ], [ 'accountcode' ], [ 'freesidestatus' ] ],
+      'index' => [ [ 'calldate' ], [ 'dst' ], [ 'accountcode' ], [ 'freesidestatus' ], [ 'cdrbatch' ], ],
     },
 
     'cdr_calltype' => {
@@ -2080,10 +2122,19 @@ sub tables_hashref {
         'state',       'char', 'NULL',  2, '', '', 
         'npa',         'char',     '',  3, '', '', 
         'nxx',         'char', 'NULL',  3, '', '', 
+        'station',     'char', 'NULL',  4, '', '',
+        'svcnum',      'int',     'NULL',      '', '', '',
+        'availbatch', 'varchar', 'NULL', $char_d, '', '',
       ],
       'primary_key' => 'availnum',
       'unique' => [],
-      'index'  => [ [ 'exportnum', 'countrycode', 'state' ] ],
+      'index'  => [ [ 'exportnum', 'countrycode', 'state' ],     #npa search
+                    [ 'exportnum', 'countrycode', 'npa' ],       #nxx search
+                    [ 'exportnum', 'countrycode', 'npa', 'nxx' ],#station search
+                    [ 'exportnum', 'countrycode', 'npa', 'nxx', 'station' ], # #
+                    [ 'svcnum' ],
+                    [ 'availbatch' ],
+                  ],
     },
 
     'reason_type' => {