options to limit access to full customer list, #15928
[freeside.git] / FS / FS / Schema.pm
index 7825973..fdf29e0 100644 (file)
@@ -70,7 +70,7 @@ sub dbdef { $dbdef; }
 Returns the current canoical database definition as defined in this file.
 
 Optionally, pass a DBI data source to enable syntax specific to that database.
-Currently, this enables "TYPE=InnoDB" for MySQL databases.
+Currently, this enables "ENGINE=InnoDB" for MySQL databases.
 
 =cut
 
@@ -79,7 +79,7 @@ sub dbdef_dist {
   
   my $local_options = '';
   if ( $datasrc =~ /^dbi:mysql/i ) {
-    $local_options = 'TYPE=InnoDB';
+    $local_options = 'ENGINE=InnoDB';
   }
 
   ###
@@ -896,6 +896,7 @@ sub tables_hashref {
         'geocode',  'varchar', 'NULL', 20,  '', '',
         'censustract', 'varchar', 'NULL', 20,  '', '', # 7 to save space?
         'censusyear', 'char', 'NULL', 4, '', '',
+        'district', 'varchar', 'NULL', 20, '', '',
         'tax',      'char', 'NULL', 1, '', '', 
         'otaker',   'varchar', 'NULL',    32, '', '', 
         'usernum',   'int', 'NULL', '', '', '',
@@ -1054,6 +1055,7 @@ sub tables_hashref {
         'coord_auto',         'char', 'NULL',       1, '', '',
         'country',            'char',     '',       2, '', '', 
         'geocode',         'varchar', 'NULL',      20, '', '',
+        'district',        'varchar', 'NULL',      20, '', '',
         'location_type',   'varchar', 'NULL',      20, '', '',
         'location_number', 'varchar', 'NULL',      20, '', '',
         'location_kind',      'char', 'NULL',       1, '', '',
@@ -1178,11 +1180,12 @@ sub tables_hashref {
       'index'       => [ [ 'custnum' ], [ 'billpkgnum' ] ],
     },
 
-    'cust_main_county' => { #county+state+country are checked off the
-                            #cust_main_county for validation and to provide
-                            # a tax rate.
+    'cust_main_county' => { #district+city+county+state+country are checked 
+                            #off the cust_main_county for validation and to 
+                            #provide a tax rate.
       'columns' => [
         'taxnum',   'serial',   '',    '', '', '', 
+        'district', 'varchar',  'NULL',    20, '', '',
         'city',     'varchar',  'NULL',    $char_d, '', '',
         'county',   'varchar',  'NULL',    $char_d, '', '', 
         'state',    'varchar',  'NULL',    $char_d, '', '', 
@@ -1197,7 +1200,8 @@ sub tables_hashref {
       'primary_key' => 'taxnum',
       'unique' => [],
   #    'unique' => [ ['taxnum'], ['state', 'county'] ],
-      'index' => [ [ 'city' ], [ 'county' ], [ 'state' ], [ 'country' ],
+      'index' => [ [ 'district' ], [ 'city' ], [ 'county' ], [ 'state' ], 
+                   [ 'country' ],
                    [ 'taxclass' ],
                  ],
     },
@@ -1328,12 +1332,17 @@ sub tables_hashref {
                                                  # index into payby table
                                                  # eventually
         'payinfo',  'varchar',   'NULL', 512, '', '', #see cust_main above
-       'paymask', 'varchar', 'NULL', $char_d, '', '', 
+        'paymask', 'varchar', 'NULL', $char_d, '', '', 
         'paydate',  'varchar', 'NULL', 10, '', '', 
         'paybatch', 'varchar',   'NULL', $char_d, '', '', #for auditing purposes.
         'payunique', 'varchar', 'NULL', $char_d, '', '', #separate paybatch "unique" functions from current usage
         'closed',    'char', 'NULL', 1, '', '', 
         'pkgnum', 'int', 'NULL', '', '', '', #desired pkgnum for pkg-balances
+        # cash/check deposit info fields
+        'bank',       'varchar', 'NULL', $char_d, '', '',
+        'depositor',  'varchar', 'NULL', $char_d, '', '',
+        'account',    'varchar', 'NULL', 20,      '', '',
+        'teller',     'varchar', 'NULL', 20,      '', '',
       ],
       'primary_key' => 'paynum',
       #i guess not now, with cust_pay_pending, if we actually make it here, we _do_ want to record it# 'unique' => [ [ 'payunique' ] ],
@@ -1477,6 +1486,7 @@ sub tables_hashref {
         'last_bill',      @date_type,             '', '', 
         'susp',           @date_type,             '', '', 
         'adjourn',        @date_type,             '', '', 
+        'resume',         @date_type,             '', '', 
         'cancel',         @date_type,             '', '', 
         'expire',         @date_type,             '', '', 
         'contract_end',   @date_type,             '', '',
@@ -1805,11 +1815,12 @@ sub tables_hashref {
 
     'part_svc' => {
       'columns' => [
-        'svcpart',    'serial',    '',   '', '', '', 
-        'svc',        'varchar',   '',   $char_d, '', '', 
-        'svcdb',      'varchar',   '',   $char_d, '', '', 
-        'disabled',   'char',  'NULL',   1, '', '', 
-        'preserve',   'char', 'NULL',  1, '', '',
+        'svcpart',             'serial',     '',        '', '', '', 
+        'svc',                'varchar',     '',   $char_d, '', '', 
+        'svcdb',              'varchar',     '',   $char_d, '', '', 
+        'disabled',              'char', 'NULL',         1, '', '', 
+        'preserve',              'char', 'NULL',         1, '', '',
+        'selfservice_access', 'varchar', 'NULL',   $char_d, '', '',
       ],
       'primary_key' => 'svcpart',
       'unique' => [],
@@ -2123,12 +2134,13 @@ sub tables_hashref {
 
     'hardware_type' => {
       'columns' => [
-        'typenum',  'serial', '',      '', '', '',
-        'classnum',    'int', '',      '', '', '',
-        'model',   'varchar', '', $char_d, '', '',
+        'typenum',  'serial',     '',      '', '', '',
+        'classnum',    'int',     '',      '', '', '',
+        'model',   'varchar',     '', $char_d, '', '',
+        'revision','varchar', 'NULL', $char_d, '', '',
       ],
       'primary_key' => 'typenum',
-      'unique' => [ ],
+      'unique' => [ [ 'classnum', 'model', 'revision' ] ],
       'index'  => [ ],
     },
 
@@ -2480,6 +2492,7 @@ sub tables_hashref {
         'routername', 'varchar', '', $char_d, '', '', 
         'svcnum', 'int', 'NULL', '', '', '', 
         'agentnum',   'int', 'NULL', '', '', '', 
+        'manual_addr', 'char', 'NULL', 1, '', '',
       ],
       'primary_key' => 'routernum',
       'unique'      => [],
@@ -2515,6 +2528,7 @@ sub tables_hashref {
       'columns' => [
         'svcnum',                  'int',     '',      '', '', '', 
         'description',         'varchar', 'NULL', $char_d, '', '', 
+        'routernum',               'int', 'NULL',      '', '', '',
         'blocknum',                'int', 'NULL',      '', '', '', 
         'sectornum',               'int', 'NULL',      '', '', '',
         'speed_up',                'int', 'NULL',      '', '', '', 
@@ -3590,6 +3604,19 @@ sub tables_hashref {
       'index'  => [],
     },
 
+    'upgrade_journal' => {
+      'columns' => [
+        'upgradenum', 'serial', '', '', '', '',
+        '_date', 'int', '', '', '', '',
+        'upgrade', 'varchar', '', $char_d, '', '',
+        'status', 'varchar', '', $char_d, '', '',
+        'statustext', 'varchar', 'NULL', $char_d, '', '',
+      ],
+      'primary_key' => 'upgradenum',
+      'unique' => [ [ 'upgradenum' ] ],
+      'index' => [ [ 'upgrade' ] ],
+    },
+
     %{ tables_hashref_torrus() },
 
     # tables of ours for doing torrus virtual port combining