. is used in some implementations of classic crypt
[freeside.git] / FS / FS / Schema.pm
index 22bd19e..941eafc 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',
@@ -324,17 +332,17 @@ sub tables_hashref {
         'agentnum',          'serial',    '',       '', '', '', 
         'agent',            'varchar',    '',  $char_d, '', '', 
         'typenum',              'int',    '',       '', '', '', 
-        'disabled',            'char', 'NULL',       1, '', '', 
         'ticketing_queueid',    'int', 'NULL',      '', '', '', 
         'invoice_template', 'varchar', 'NULL', $char_d, '', '',
+        'agent_custnum',        'int', 'NULL',      '', '', '',
+        'disabled',            'char', 'NULL',       1, '', '', 
         'username',         'varchar', 'NULL', $char_d, '', '', #deprecated
         '_password',        'varchar', 'NULL', $char_d, '', '', #deprecated
         'freq',              'int', 'NULL', '', '', '', #deprecated (never used)
         'prog',                     @perl_type, '', '', #deprecated (never used)
-
       ],
       'primary_key' => 'agentnum',
-      'unique' => [],
+      'unique' => [ [ 'agent_custnum' ] ], #one agent per customer?
       'index' => [ ['typenum'], ['disabled'] ],
     },
 
@@ -597,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, '', '', 
@@ -1577,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' ] ],