],
});
+ $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',
'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'] ],
},
'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, '', '',
'ip_gateway', 'varchar', '', 15, '', '',
'ip_netmask', 'int', '', '', '', '',
'agentnum', 'int', 'NULL', '', '', '',
+ 'manual_flag', 'char', 'NULL', 1, '', '',
],
'primary_key' => 'blocknum',
'unique' => [ [ 'blocknum', 'routernum' ] ],
'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' => {