X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FSchema.pm;h=a71b90249bd38294a46518ddf16e9008b2ef4996;hb=5773eb8d8b4168213482a7e61aa37e0dd05c69da;hp=c05bd9c13e9e9864a422ebd9cbd9b3639b426db2;hpb=a3fc8a9a062757f2c288a36eece7367e8f653e5f;p=freeside.git diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm index c05bd9c13..a71b90249 100644 --- a/FS/FS/Schema.pm +++ b/FS/FS/Schema.pm @@ -189,9 +189,9 @@ sub dbdef_dist { my $tables_hashref_torrus = tables_hashref_torrus(); - #create history tables (false laziness w/create-history-tables) + #create history tables foreach my $table ( - grep { ! /^clientapi_session/ + grep { ! /^(clientapi|access_user)_session/ && ! /^h_/ && ! /^log(_context)?$/ && ! /^legacy_cust_history$/ @@ -1383,6 +1383,24 @@ sub tables_hashref { 'index' => [ ['pkgpart'], ], }, + 'quotation_pkg_detail' => { + 'columns' => [ + 'detailnum', 'serial', '', '', '', '', + 'quotationpkgnum', 'int', '', '', '', '', + 'format', 'char', 'NULL', 1, '', '', # not used for anything + 'detail', 'varchar', '', 255, '', '', + ], + 'primary_key' => 'detailnum', + 'unique' => [], + 'index' => [ [ 'quotationpkgnum' ] ], + 'foreign_keys' => [ + { columns => [ 'quotationpkgnum' ], + table => 'quotation_pkg', + references => [ 'quotationpkgnum' ], + }, + ], + }, + 'quotation_pkg_discount' => { 'columns' => [ 'quotationpkgdiscountnum', 'serial', '', '', '', '', @@ -2116,7 +2134,8 @@ sub tables_hashref { 'refund', @money_type, '', '', 'otaker', 'varchar', 'NULL', 32, '', '', 'usernum', 'int', 'NULL', '', '', '', - 'reason', 'varchar', '', $char_d, '', '', + 'reason', 'varchar', 'NULL', $char_d, '', '', + 'reasonnum', 'int', 'NULL', '', '', '', 'payby', 'char', '', 4, '', '', # CARD/BILL/COMP, should # be index into payby # table eventually @@ -2405,6 +2424,7 @@ sub tables_hashref { 'quantity', 'int', '', '', '', '', 'primary_svc','char', 'NULL', 1, '', '', 'hidden', 'char', 'NULL', 1, '', '', + 'provision_hold', 'char', 'NULL', 1, '', '', ], 'primary_key' => 'pkgsvcnum', 'unique' => [ ['pkgpart', 'svcpart'] ], @@ -2961,6 +2981,7 @@ sub tables_hashref { 'custnum', 'int', 'NULL', '', '', '', 'secure', 'char', 'NULL', 1, '', '', 'priority', 'int', 'NULL', '', '', '', + 'usernum', 'int', 'NULL', '', '', '', ], 'primary_key' => 'jobnum', 'unique' => [], @@ -3038,6 +3059,8 @@ sub tables_hashref { 'exporttype', 'varchar', '', $char_d, '', '', 'nodomain', 'char', 'NULL', 1, '', '', 'default_machine','int', 'NULL', '', '', '', + 'no_suspend', 'char', 'NULL', 1, '', '', + # could also have 'no_insert', 'no_replace', etc. ], 'primary_key' => 'exportnum', 'unique' => [], @@ -3796,6 +3819,7 @@ sub tables_hashref { 'rated_ratedetailnum', 'int', 'NULL', '', '', '', 'rated_classnum', 'int', 'NULL', '', '', '', 'rated_ratename', 'varchar', 'NULL', $char_d, '', '', + 'rated_cost', 'decimal', 'NULL', '10,4', '', '', 'carrierid', 'bigint', 'NULL', '', '', '', @@ -3820,6 +3844,9 @@ sub tables_hashref { #new 'cdrbatchnum', 'int', 'NULL', '', '', '', + # FK to cust_bill_pkg_detail; having a value here absolutely means + # that the CDR appears on an invoice + 'detailnum', 'bigint', 'NULL', '', '', '', ], 'primary_key' => 'acctid', 'unique' => [], @@ -3944,6 +3971,19 @@ sub tables_hashref { 'index' => [], }, + 'access_user_session' => { + 'columns' => [ + 'sessionnum', 'serial', '', '', '', '', + 'sessionkey', 'varchar', '', $char_d, '', '', + 'usernum', 'int', '', '', '', '', + 'start_date', @date_type, '', '', + 'last_date', @date_type, '', '', + ], + 'primary_key' => 'sessionnum', + 'unique' => [ [ 'sessionkey' ] ], + 'index' => [], + }, + 'access_user' => { 'columns' => [ 'usernum', 'serial', '', '', '', '', @@ -4673,6 +4713,125 @@ sub tables_hashref { 'unique' => [], 'index' => [ [ 'providernum' ], [ 'typenum' ] ], }, + + 'svc_fiber' => { + 'columns' => [ + 'svcnum', 'int', '', '', '', '', + 'oltnum', 'int', 'NULL', '', '', '', + 'shelf', 'int', 'NULL', '', '', '', + 'card', 'int', 'NULL', '', '', '', + 'olt_port', 'int', 'NULL', '', '', '', + 'ont_id', 'int', 'NULL', '', '', '', + 'ont_typenum', 'int', 'NULL', '', '', '', + 'ont_serial', 'varchar', 'NULL', $char_d, '', '', + 'ont_port', 'varchar', 'NULL', 16, '', '', + 'vlan', 'int', 'NULL', '', '', '', + 'signal', 'int', 'NULL', '', '', '', + 'speed_up', 'int', 'NULL', '', '', '', + 'speed_down', 'int', 'NULL', '', '', '', + 'ont_install','varchar', 'NULL', $char_d, '', '', + ], + 'primary_key' => 'svcnum', + 'unique' => [ ], + 'index' => [ [ 'ont_serial' ] ], + }, + + 'fiber_olt' => { + 'columns' => [ + 'oltnum', 'serial', '', '', '', '', + 'oltname', 'varchar', '', $char_d, '', '', + 'serial', 'varchar', '', $char_d, '', '', + 'disabled', 'char', 'NULL', 1, '', '', + ], + 'primary_key' => 'oltnum', + 'unique' => [ ], + 'index' => [ ], + }, + + 'vend_main' => { + 'columns' => [ + 'vendnum', 'serial', '', '', '', '', + 'vendname', 'varchar', '', $char_d, '', '', + 'classnum', 'int', '', '', '', '', + 'disabled', 'char', 'NULL', 1, '', '', + ], + 'primary_key' => 'vendnum', + 'unique' => [ ['vendname', 'disabled'] ], + 'index' => [], + 'foreign_keys' => [ + { columns => [ 'classnum' ], + table => 'vend_class', + }, + ], + }, + + 'vend_class' => { + 'columns' => [ + 'classnum', 'serial', '', '', '', '', + 'classname', 'varchar', '', $char_d, '', '', + 'disabled', 'char', 'NULL', 1, '', '', + ], + 'primary_key' => 'classnum', + 'unique' => [], + 'index' => [ ['disabled'] ], + }, + + 'vend_bill' => { + 'columns' => [ + 'vendbillnum', 'serial', '', '', '', '', + 'vendnum', 'int', '', '', '', '', + #'_date', @date_type, '', '', + '_date', 'int', '', '', '', '', + 'charged', @money_type, '', '', + ], + 'primary_key' => 'vendbillnum', + 'unique' => [], + 'index' => [ ['vendnum'], ['_date'], ], + 'foreign_keys' => [ + { columns => [ 'vendnum' ], + table => 'vend_main', + }, + ], + }, + + 'vend_pay' => { + 'columns' => [ + 'vendpaynum', 'serial', '', '', '', '', + 'vendnum', 'int', '', '', '', '', + #'_date', @date_type, '', '', + '_date', 'int', '', '', '', '', + 'paid', @money_type, '', '', + ], + 'primary_key' => 'vendpaynum', + 'unique' => [], + 'index' => [ [ 'vendnum' ], [ '_date' ], ], + 'foreign_keys' => [ + { columns => [ 'vendnum' ], + table => 'vend_main', + }, + ], + }, + + 'vend_bill_pay' => { + 'columns' => [ + 'vendbillpaynum', 'serial', '', '', '', '', + 'vendbillnum', 'int', '', '', '', '', + 'vendpaynum', 'int', '', '', '', '', + 'amount', @money_type, '', '', + #? '_date', @date_type, '', '', + ], + 'primary_key' => 'vendbillpaynum', + 'unique' => [], + 'index' => [ [ 'vendbillnum' ], [ 'vendpaynum' ] ], + 'foreign_keys' => [ + { columns => [ 'vendbillnum' ], + table => 'vend_bill', + }, + { columns => [ 'vendpaynum' ], + table => 'vend_pay', + }, + ], + }, %{ tables_hashref_torrus() }, # tables of ours for doing torrus virtual port combining @@ -4781,6 +4940,7 @@ sub tables_hashref { 'zonenum', 'serial', '', '', '', '', 'description', 'char', 'NULL', $char_d, '', '', 'agentnum', 'int', '', '', '', '', + 'censusyear', 'char', 'NULL', 4, '', '', 'dbaname', 'char', 'NULL', $char_d, '', '', 'zonetype', 'char', '', 1, '', '', 'technology', 'int', '', '', '', '', @@ -4806,7 +4966,7 @@ sub tables_hashref { 'blocknum', 'serial', '', '', '', '', 'zonenum', 'int', '', '', '', '', 'censusblock', 'char', '', 15, '', '', - 'censusyear', 'char', '', 4, '', '', + 'censusyear', 'char','NULL', 4, '', '', ], 'primary_key' => 'blocknum', 'unique' => [], @@ -4839,6 +4999,83 @@ sub tables_hashref { 'index' => [ ['svcnum'], ['imported'] ], }, + 'report_batch' => { + 'columns' => [ + 'reportbatchnum', 'serial', '', '', '', '', + 'reportname', 'varchar', '', 255, '', '', + 'agentnum', 'int', 'NULL', '', '', '', + 'send_date', @date_type, '', '', + 'sdate', @date_type, '', '', + 'edate', @date_type, '', '', + 'usernum', 'int', 'NULL', '', '', '', + 'msgnum', 'int', 'NULL', '', '', '', + # add report params here as necessary + ], + 'primary_key' => 'reportbatchnum', + 'unique' => [], + 'index' => [], + 'foreign_keys' => [ + { columns => [ 'agentnum' ], + table => 'agent', + references => [ 'agentnum' ], + }, + { columns => [ 'usernum' ], + table => 'access_user', + references => [ 'usernum' ], + }, + { columns => [ 'msgnum' ], + table => 'msg_template', + references => [ 'msgnum' ], + }, + ], + }, + + 'password_history' => { + 'columns' => [ + 'passwordnum', 'serial', '', '', '', '', + '_password', 'varchar', 'NULL', $char_d, '', '', + 'encryption_method', 'varchar', 'NULL', $char_d, '', '', + 'created', @date_type, '', '', + # each table that needs password history gets a column here, and + # an entry in foreign_keys. + 'svc_acct__svcnum', 'int', 'NULL', '', '', '', + 'svc_dsl__svcnum', 'int', 'NULL', '', '', '', + 'svc_alarm__svcnum', 'int', 'NULL', '', '', '', + 'agent__agentnum', 'int', 'NULL', '', '', '', + 'contact__contactnum', 'int', 'NULL', '', '', '', + 'access_user__usernum', 'int', 'NULL', '', '', '', + ], + 'primary_key' => 'passwordnum', + 'unique' => [], + 'index' => [], + 'foreign_keys' => [ + { columns => [ 'svc_acct__svcnum' ], + table => 'svc_acct', + references => [ 'svcnum' ], + }, + { columns => [ 'svc_dsl__svcnum' ], + table => 'svc_dsl', + references => [ 'svcnum' ], + }, + { columns => [ 'svc_alarm__svcnum' ], + table => 'svc_alarm', + references => [ 'svcnum' ], + }, + { columns => [ 'agent__agentnum' ], + table => 'agent', + references => [ 'agentnum' ], + }, + { columns => [ 'contact__contactnum' ], + table => 'contact', + references => [ 'contactnum' ], + }, + { columns => [ 'access_user__usernum' ], + table => 'access_user', + references => [ 'usernum' ], + }, + ], + }, + # name type nullability length default local #'new_table' => {