X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FSchema.pm;h=88bb6acc3e7e64e9a3b795d597b9072d5191922f;hb=a37da3d6492e60f723b277b90565abc34d8990d6;hp=b3d8a56f12d5ddbac34ebc75a88af117be19aa37;hpb=4845aaefedfcbaa25716694b6d80f3dd6d56530a;p=freeside.git diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm index b3d8a56f1..88bb6acc3 100644 --- a/FS/FS/Schema.pm +++ b/FS/FS/Schema.pm @@ -16,14 +16,6 @@ use FS::UID qw(datasrc); $DEBUG = 0; $me = '[FS::Schema]'; -#hardcoded now... -##ask FS::UID to run this stuff for us later -#FS::UID->install_callback( sub { -# #$conf = new FS::Conf; -# &reload_dbdef("/usr/local/etc/freeside/dbdef.". datasrc) -# unless $setup_hack; #$setup_hack needed now? -#} ); - =head1 NAME FS::Schema - Freeside database schema @@ -59,7 +51,7 @@ sub reload_dbdef { unless ( exists $dbdef_cache{$file} ) { warn "[debug]$me loading dbdef for $file\n" if $DEBUG; $dbdef_cache{$file} = DBIx::DBSchema->load( $file ) - or die "can't load database schema from $file"; + or die "can't load database schema from $file: $DBIx::DBSchema::errstr\n"; } else { warn "[debug]$me re-using cached dbdef for $file\n" if $DEBUG; } @@ -327,6 +319,7 @@ sub tables_hashref { 'weight', 'int', '', '', '', '', 'plan', 'varchar', 'NULL', $char_d, '', '', 'plandata', 'text', 'NULL', '', '', '', + 'reason', 'int', 'NULL', '', '', '', 'disabled', 'char', 'NULL', 1, '', '', ], 'primary_key' => 'eventpart', @@ -397,6 +390,8 @@ sub tables_hashref { 'billpkgnum', 'int', '', '', '', '', 'amount', @money_type, '', '', 'setuprecur', 'varchar', '', $char_d, '', '', + 'sdate', @date_type, '', '', + 'edate', @date_type, '', '', ], 'primary_key' => 'creditbillpkgnum', 'unique' => [], @@ -413,6 +408,8 @@ sub tables_hashref { # 'middle', 'varchar', 'NULL', $char_d, '', '', 'first', 'varchar', '', $char_d, '', '', 'ss', 'varchar', 'NULL', 11, '', '', + 'birthdate' ,@date_type, '', '', + 'signupdate',@date_type, '', '', 'company', 'varchar', 'NULL', $char_d, '', '', 'address1', 'varchar', '', $char_d, '', '', 'address2', 'varchar', 'NULL', $char_d, '', '', @@ -479,6 +476,19 @@ sub tables_hashref { 'index' => [ ['custnum'], ], }, + 'cust_main_note' => { + 'columns' => [ + 'notenum', 'serial', '', '', '', '', + 'custnum', 'int', '', '', '', '', + '_date', @date_type, '', '', + 'otaker', 'varchar', '', 32, '', '', + 'comments', 'text', 'NULL', '', '', '', + ], + 'primary_key' => 'notenum', + 'unique' => [], + 'index' => [ [ 'custnum' ], [ '_date' ], ], + }, + 'cust_main_county' => { #county+state+country are checked off the #cust_main_county for validation and to provide # a tax rate. @@ -510,7 +520,8 @@ sub tables_hashref { 'payby', 'char', '', 4, '', '', # CARD/BILL/COMP, should be # index into payby table # eventually - 'payinfo', 'varchar', 'NULL', $char_d, '', '', #see cust_main above + 'payinfo', 'varchar', 'NULL', 512, '', '', #see cust_main above + 'paymask', 'varchar', 'NULL', $char_d, '', '', 'paybatch', 'varchar', 'NULL', $char_d, '', '', #for auditing purposes. 'closed', 'char', 'NULL', 1, '', '', ], @@ -528,7 +539,8 @@ sub tables_hashref { 'payby', 'char', '', 4, '', '', # CARD/BILL/COMP, should be # index into payby table # eventually - 'payinfo', 'varchar', 'NULL', $char_d, '', '', #see cust_main above + 'payinfo', 'varchar', 'NULL', 512, '', '', #see cust_main above + 'paymask', 'varchar', 'NULL', $char_d, '', '', 'paybatch', 'varchar', 'NULL', $char_d, '', '', #for auditing purposes. 'closed', 'char', 'NULL', 1, '', '', 'void_date', @date_type, '', '', @@ -553,6 +565,19 @@ sub tables_hashref { 'index' => [ [ 'paynum' ], [ 'invnum' ] ], }, + 'cust_bill_pay_batch' => { + 'columns' => [ + 'billpaynum', 'serial', '', '', '', '', + 'invnum', 'int', '', '', '', '', + 'paybatchnum', 'int', '', '', '', '', + 'amount', @money_type, '', '', + '_date', @date_type, '', '', + ], + 'primary_key' => 'billpaynum', + 'unique' => [], + 'index' => [ [ 'paybatchnum' ], [ 'invnum' ] ], + }, + 'cust_bill_pay_pkg' => { 'columns' => [ 'billpaypkgnum', 'serial', '', '', '', '', @@ -560,6 +585,8 @@ sub tables_hashref { 'billpkgnum', 'int', '', '', '', '', 'amount', @money_type, '', '', 'setuprecur', 'varchar', '', $char_d, '', '', + 'sdate', @date_type, '', '', + 'edate', @date_type, '', '', ], 'primary_key' => 'billpaypkgnum', 'unique' => [], @@ -569,6 +596,7 @@ sub tables_hashref { 'pay_batch' => { #batches of payments to an external processor 'columns' => [ 'batchnum', 'serial', '', '', '', '', + 'payby', 'char', '', 4, '', '', # CARD/CHEK 'status', 'char', 'NULL', 1, '', '', 'download', @date_type, '', '', 'upload', @date_type, '', '', @@ -626,6 +654,19 @@ sub tables_hashref { 'index' => [ ['custnum'], ['pkgpart'] ], }, + 'cust_pkg_reason' => { + 'columns' => [ + 'num', 'serial', '', '', '', '', + 'pkgnum', 'int', '', '', '', '', + 'reasonnum','int', '', '', '', '', + 'otaker', 'varchar', '', 32, '', '', + 'date', @date_type, '', '', + ], + 'primary_key' => 'num', + 'unique' => [], + 'index' => [], + }, + 'cust_refund' => { 'columns' => [ 'refundnum', 'serial', '', '', '', '', @@ -638,7 +679,8 @@ sub tables_hashref { 'payby', 'char', '', 4, '', '', # CARD/BILL/COMP, should # be index into payby # table eventually - 'payinfo', 'varchar', 'NULL', $char_d, '', '', #see cust_main above + 'payinfo', 'varchar', 'NULL', 512, '', '', #see cust_main above + 'paymask', 'varchar', 'NULL', $char_d, '', '', 'paybatch', 'varchar', 'NULL', $char_d, '', '', 'closed', 'char', 'NULL', 1, '', '', ], @@ -798,6 +840,13 @@ sub tables_hashref { 'quota', 'varchar', 'NULL', $char_d, '', '', 'slipip', 'varchar', 'NULL', 15, '', '', #four TINYINTs, bah. 'seconds', 'int', 'NULL', '', '', '', #uhhhh + 'seconds_threshold', 'int', 'NULL', '', '', '', + 'upbytes', 'bigint', 'NULL', '', '', '', + 'upbytes_threshold', 'bigint', 'NULL', '', '', '', + 'downbytes', 'bigint', 'NULL', '', '', '', + 'downbytes_threshold', 'bigint', 'NULL', '', '', '', + 'totalbytes','bigint', 'NULL', '', '', '', + 'totalbytes_threshold', 'bigint', 'NULL', '', '', '', 'domsvc', 'int', '', '', '', '', ], 'primary_key' => 'svcnum', @@ -818,13 +867,20 @@ sub tables_hashref { 'svc_domain' => { 'columns' => [ - 'svcnum', 'int', '', '', '', '', - 'domain', 'varchar', '', $char_d, '', '', - 'catchall', 'int', 'NULL', '', '', '', + 'svcnum', 'int', '', '', '', '', + 'domain', 'varchar', '', $char_d, '', '', + 'suffix', 'varchar', 'NULL', $char_d, '', '', + 'catchall', 'int', 'NULL', '', '', '', + 'parent_svcnum', 'int', 'NULL', '', '', '', + 'registrarnum', 'int', 'NULL', '', '', '', + 'registrarkey', 'varchar', 'NULL', '', '', '', + 'setup_date', @date_type, '', '', + 'renewal_interval', 'int', 'NULL', '', '', '', + 'expiration_date', @date_type, '', '', ], 'primary_key' => 'svcnum', - 'unique' => [ ['domain'] ], - 'index' => [], + 'unique' => [ ], + 'index' => [ ['domain'] ], }, 'domain_record' => { @@ -841,6 +897,16 @@ sub tables_hashref { 'index' => [ ['svcnum'] ], }, + 'registrar' => { + 'columns' => [ + 'registrarnum', 'serial', '', '', '', '', + 'registrarname', 'varchar', '', $char_d, '', '', + ], + 'primary_key' => 'registrarnum', + 'unique' => [], + 'index' => [], + }, + 'svc_forward' => { 'columns' => [ 'svcnum', 'int', '', '', '', '', @@ -884,6 +950,9 @@ sub tables_hashref { 'identifier', 'varchar', '', $char_d, '', '', 'amount', @money_type, '', '', 'seconds', 'int', 'NULL', '', '', '', + 'upbytes', 'bigint', 'NULL', '', '', '', + 'downbytes', 'bigint', 'NULL', '', '', '', + 'totalbytes', 'bigint', 'NULL', '', '', '', 'agentnum', 'int', 'NULL', '', '', '', ], 'primary_key' => 'prepaynum', @@ -1092,10 +1161,17 @@ sub tables_hashref { 'svc_broadband' => { 'columns' => [ 'svcnum', 'int', '', '', '', '', + 'description', 'varchar', 'NULL', $char_d, '', '', 'blocknum', 'int', '', '', '', '', 'speed_up', 'int', '', '', '', '', 'speed_down', 'int', '', '', '', '', 'ip_addr', 'varchar', '', 15, '', '', + 'mac_addr', 'varchar', 'NULL', 12, '', '', + 'authkey', 'varchar', 'NULL', 32, '', '', + 'latitude', 'decimal', 'NULL', '', '', '', + 'longitude', 'decimal', 'NULL', '', '', '', + 'altitude', 'decimal', 'NULL', '', '', '', + 'vlan_profile', 'varchar', 'NULL', $char_d, '', '', ], 'primary_key' => 'svcnum', 'unique' => [], @@ -1328,25 +1404,15 @@ sub tables_hashref { 'index' => [], }, - 'cancel_reason' => { - 'columns' => [ - 'reasonnum', 'serial', '', '', '', '', - 'reason', 'varchar', '', $char_d, '', '', - 'disabled', 'char', 'NULL', 1, '', '', - ], - 'primary_key' => 'reasonnum', - 'unique' => [], - 'index' => [ [ 'disabled' ] ], - }, - 'pkg_class' => { 'columns' => [ 'classnum', 'serial', '', '', '', '', 'classname', 'varchar', '', $char_d, '', '', + 'disabled', 'char', 'NULL', 1, '', '', ], 'primary_key' => 'classnum', 'unique' => [], - 'index' => [], + 'index' => [ ['disabled'] ], }, 'cdr' => { @@ -1583,7 +1649,30 @@ sub tables_hashref { 'index' => [ [ 'countrycode', 'phonenum' ] ], }, - }; + 'reason_type' => { + 'columns' => [ + 'typenum', 'serial', '', '', '', '', + 'class', 'char', '', 1, '', '', + 'type', 'varchar', '', $char_d, '', '', + ], + 'primary_key' => 'typenum', + 'unique' => [], + 'index' => [], + }, + + 'reason' => { + 'columns' => [ + 'reasonnum', 'serial', '', '', '', '', + 'reason_type', 'int', '', '', '', '', + 'reason', 'varchar', '', $char_d, '', '', + 'disabled', 'char', 'NULL', 1, '', '', + ], + 'primary_key' => 'reasonnum', + 'unique' => [], + 'index' => [], + }, + + # name type nullability length default local #'new_table' => { # 'columns' => [ @@ -1594,6 +1683,8 @@ sub tables_hashref { # 'index' => [], #}, + }; + } =back