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
my $local_options = '';
if ( $datasrc =~ /^dbi:mysql/i ) {
- $local_options = 'TYPE=InnoDB';
+ $local_options = 'ENGINE=InnoDB';
}
###
'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', '', '', '',
],
},
- 'cust_recon' => { # what purpose does this serve?
+ 'cust_recon' => { # (some sort of not-well understood thing for OnPac)
'columns' => [
'reconid', 'serial', '', '', '', '',
'recondate', @date_type, '', '',
'index' => [],
},
- #eventually for cust_main too
+ 'contact_class' => {
+ 'columns' => [
+ 'classnum', 'serial', '', '', '', '',
+ 'classname', 'varchar', '', $char_d, '', '',
+ 'disabled', 'char', 'NULL', 1, '', '',
+ ],
+ 'primary_key' => 'classnum',
+ 'unique' => [],
+ 'index' => [ ['disabled'] ],
+ },
+
'contact' => {
'columns' => [
'contactnum', 'serial', '', '', '', '',
'prospectnum', 'int', 'NULL', '', '', '',
'custnum', 'int', 'NULL', '', '', '',
'locationnum', 'int', 'NULL', '', '', '', #not yet
+ 'classnum', 'int', 'NULL', '', '', '',
# 'titlenum', 'int', 'NULL', '', '', '', #eg Mr. Mrs. Dr. Rev.
'last', 'varchar', '', $char_d, '', '',
# 'middle', 'varchar', 'NULL', $char_d, '', '',
'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, '', '',
'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, '', '',
'primary_key' => 'taxnum',
'unique' => [],
# 'unique' => [ ['taxnum'], ['state', 'county'] ],
- 'index' => [ [ 'city' ], [ 'county' ], [ 'state' ], [ 'country' ],
+ 'index' => [ [ 'district' ], [ 'city' ], [ 'county' ], [ 'state' ],
+ [ 'country' ],
[ 'taxclass' ],
],
},
'last_bill', @date_type, '', '',
'susp', @date_type, '', '',
'adjourn', @date_type, '', '',
+ 'resume', @date_type, '', '',
'cancel', @date_type, '', '',
'expire', @date_type, '', '',
'contract_end', @date_type, '', '',
'percent', 'decimal', '', '7,4', '', '',
'months', 'decimal', 'NULL', '7,4', '', '',
'disabled', 'char', 'NULL', 1, '', '',
- 'setup', 'char', 'NULL', 1, '', '',
+ 'setup', 'char', 'NULL', 1, '', '',
+ #'linked', 'char', 'NULL', 1, '', '',
],
'primary_key' => 'discountnum',
'unique' => [],
'no_auto', 'char', 'NULL', 1, '', '',
'recur_show_zero', 'char', 'NULL', 1, '', '',
'setup_show_zero', 'char', 'NULL', 1, '', '',
+ 'successor', 'int', 'NULL', '', '', '',
+ 'family_pkgpart','int', 'NULL', '', '', '',
],
'primary_key' => 'pkgpart',
'unique' => [],
'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' => [ ],
},
'routername', 'varchar', '', $char_d, '', '',
'svcnum', 'int', 'NULL', '', '', '',
'agentnum', 'int', 'NULL', '', '', '',
+ 'manual_addr', 'char', 'NULL', 1, '', '',
],
'primary_key' => 'routernum',
'unique' => [],
'columns' => [
'svcnum', 'int', '', '', '', '',
'description', 'varchar', 'NULL', $char_d, '', '',
+ 'routernum', 'int', 'NULL', '', '', '',
'blocknum', 'int', 'NULL', '', '', '',
'sectornum', 'int', 'NULL', '', '', '',
'speed_up', 'int', 'NULL', '', '', '',
'lastapp', 'varchar', '', $char_d, \"''", '',
'lastdata', 'varchar', '', $char_d, \"''", '',
+ #currently only opensips
+ 'src_ip_addr', 'varchar', 'NULL', 15, '', '',
+ 'dst_ip_addr', 'varchar', 'NULL', 15, '', '',
+
#these don't seem to be logged by most of the SQL cdr_* modules
#except tds under sql-illegal names, so;
# ... don't rely on them for rating?
[ 'sessionnum' ], [ 'subscriber' ],
[ 'freesidestatus' ], [ 'freesiderewritestatus' ],
[ 'cdrbatch' ], [ 'cdrbatchnum' ],
+ [ 'src_ip_addr' ], [ 'dst_ip_addr' ],
],
},