X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2FSchema.pm;h=5a2a9bead951289804ba8ab224385033ccb888e6;hp=2d98963a8cbf421a09f1f188b39147859cfe5de2;hb=f32ac83068c6211f829f1688a1a9cdec71bc6ec7;hpb=6bc36a712285e9616a00ae38b136d7b8cd6cb58f diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm index 2d98963a8..5a2a9bead 100644 --- a/FS/FS/Schema.pm +++ b/FS/FS/Schema.pm @@ -204,6 +204,7 @@ sub dbdef_dist { && ( ! /^queue(_arg|_depend|_stat)?$/ || ! $opt->{'queue-no_history'} ) && ! $tables_hashref_torrus->{$_} && ! /^cacti_page$/ + && ! /^template_image$/ } $dbdef->tables ) { @@ -734,8 +735,9 @@ sub tables_hashref { #void fields 'void_date', @date_type, '', '', - 'reason', 'varchar', 'NULL', $char_d, '', '', - 'void_usernum', 'int', 'NULL', '', '', '', + 'reason', 'varchar', 'NULL', $char_d, '', '', + 'reasonnum', 'int', 'NULL', '', '', '', + 'void_usernum', 'int', 'NULL', '', '', '', ], 'primary_key' => 'invnum', 'unique' => [ [ 'custnum', 'agent_invid' ] ], #agentnum? huh @@ -749,6 +751,9 @@ sub tables_hashref { { columns => [ 'statementnum' ], table => 'cust_statement', #_void? both? }, + { columns => [ 'reasonnum' ], + table => 'reason', + }, { columns => [ 'void_usernum' ], table => 'access_user', references => [ 'usernum' ], @@ -1196,8 +1201,9 @@ sub tables_hashref { 'feepart', 'int', 'NULL', '', '', '', #void fields 'void_date', @date_type, '', '', - 'reason', 'varchar', 'NULL', $char_d, '', '', - 'void_usernum', 'int', 'NULL', '', '', '', + 'reason', 'varchar', 'NULL', $char_d, '', '', + 'reasonnum', 'int', 'NULL', '', '', '', + 'void_usernum', 'int', 'NULL', '', '', '', ], 'primary_key' => 'billpkgnum', 'unique' => [], @@ -1208,6 +1214,9 @@ sub tables_hashref { { columns => [ 'invnum' ], table => 'cust_bill_void', }, + { columns => [ 'reasonnum' ], + table => 'reason', + }, #pkgnum 0 and -1 are used for special things #{ columns => [ 'pkgnum' ], # table => 'cust_pkg', @@ -1961,13 +1970,31 @@ sub tables_hashref { ], }, + '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', '', '', '', '', 'quotationpkgnum', 'int', '', '', '', '', 'discountnum', 'int', '', '', '', '', - 'setup_amount', @money_typen, '', '', - 'recur_amount', @money_typen, '', '', + 'setuprecur', 'varchar', 'NULL', $char_d, '', '', + 'amount', @money_typen, '', '', #'end_date', @date_type, '', '', ], 'primary_key' => 'quotationpkgdiscountnum', @@ -2009,7 +2036,7 @@ sub tables_hashref { 'locationname', 'varchar', 'NULL', $char_d, '', '', 'address1', 'varchar', '', $char_d, '', '', 'address2', 'varchar', 'NULL', $char_d, '', '', - 'city', 'varchar', '', $char_d, '', '', + 'city', 'varchar', 'NULL', $char_d, '', '', 'county', 'varchar', 'NULL', $char_d, '', '', 'state', 'varchar', 'NULL', $char_d, '', '', 'zip', 'varchar', 'NULL', 10, '', '', @@ -2431,6 +2458,7 @@ sub tables_hashref { 'payunique', 'varchar', 'NULL', $char_d, '', '',#separate paybatch "unique" functions from current usage 'closed', 'char', 'NULL', 1, '', '', 'pkgnum', 'int', 'NULL', '', '', '', #desired pkgnum for pkg-balances + 'no_auto_apply', 'char', 'NULL', 1, '', '', # cash/check deposit info fields 'bank', 'varchar', 'NULL', $char_d, '', '', @@ -2503,6 +2531,7 @@ sub tables_hashref { #void fields 'void_date', @date_type, '', '', 'reason', 'varchar', 'NULL', $char_d, '', '', + 'reasonnum', 'int', 'NULL', '', '', '', 'void_usernum', 'int', 'NULL', '', '', '', ], 'primary_key' => 'paynum', @@ -2524,6 +2553,9 @@ sub tables_hashref { { columns => [ 'gatewaynum' ], table => 'payment_gateway', }, + { columns => [ 'reasonnum' ], + table => 'reason', + }, { columns => [ 'void_usernum' ], table => 'access_user', references => [ 'usernum' ], @@ -2639,7 +2671,7 @@ sub tables_hashref { 'first', 'varchar', '', $char_d, '', '', 'address1', 'varchar', '', $char_d, '', '', 'address2', 'varchar', 'NULL', $char_d, '', '', - 'city', 'varchar', '', $char_d, '', '', + 'city', 'varchar', 'NULL', $char_d, '', '', 'state', 'varchar', 'NULL', $char_d, '', '', 'zip', 'varchar', 'NULL', 10, '', '', 'country', 'char', '', 2, '', '', @@ -2886,6 +2918,7 @@ sub tables_hashref { 'otaker', 'varchar', 'NULL', 32, '', '', 'usernum', 'int', 'NULL', '', '', '', 'disabled', 'char', 'NULL', 1, '', '', + 'setuprecur', 'char', 'NULL', 5, '', '', ], 'primary_key' => 'pkgdiscountnum', 'unique' => [], @@ -3197,6 +3230,10 @@ sub tables_hashref { 'delay_start', 'int', 'NULL', '', '', '', 'start_on_hold', 'char', 'NULL', 1, '', '', 'agent_pkgpartid', 'varchar', 'NULL', 20, '', '', + 'expire_months', 'int', 'NULL', '', '', '', + 'adjourn_months', 'int', 'NULL', '', '', '', + 'contract_end_months','int','NULL', '', '', '', + 'change_to_pkgpart', 'int', 'NULL', '', '', '', ], 'primary_key' => 'pkgpart', 'unique' => [], @@ -3225,6 +3262,10 @@ sub tables_hashref { table => 'part_pkg', references => [ 'pkgpart' ], }, + { columns => [ 'change_to_pkgpart' ], + table => 'part_pkg', + references => [ 'pkgpart' ], + }, ], }, @@ -3534,6 +3575,7 @@ sub tables_hashref { 'primary_svc', 'char', 'NULL', 1, '', '', 'hidden', 'char', 'NULL', 1, '', '', 'bulk_skip', 'char', 'NULL', 1, '', '', + 'provision_hold', 'char', 'NULL', 1, '', '', ], 'primary_key' => 'pkgsvcnum', 'unique' => [ ['pkgpart', 'svcpart'] ], @@ -4322,6 +4364,7 @@ sub tables_hashref { 'custnum', 'int', 'NULL', '', '', '', 'secure', 'char', 'NULL', 1, '', '', 'priority', 'int', 'NULL', '', '', '', + 'usernum', 'int', 'NULL', '', '', '', ], 'primary_key' => 'jobnum', 'unique' => [], @@ -4335,6 +4378,9 @@ sub tables_hashref { { columns => [ 'custnum' ], table => 'cust_main', }, + { columns => [ 'usernum' ], + table => 'access_user', + }, ], }, @@ -5734,6 +5780,18 @@ sub tables_hashref { 'index' => [], }, + 'access_user_log' => { + 'columns' => [ + 'lognum', 'serial', '', '', '', '', + 'usernum', 'int', '', '', '', '', + 'path', 'varchar', '', 2*$char_d, '', '', + '_date', @date_type, '', '', + ], + 'primary_key' => 'lognum', + 'unique' => [], + 'index' => [ ['usernum'], ['path'], ['_date'] ], + }, + 'sched_item' => { 'columns' => [ 'itemnum', 'serial', '', '', '', '', @@ -6293,8 +6351,11 @@ sub tables_hashref { 'mime_type', 'varchar', '', $char_d, '', '', 'body', 'blob', 'NULL', '', '', '', 'disabled', 'char', 'NULL', 1, '', '', + # migrate these to msg_template_email 'from_addr', 'varchar', 'NULL', 255, '', '', 'bcc_addr', 'varchar', 'NULL', 255, '', '', + # change to not null on v5 + 'msgclass', 'varchar', 'NULL', 16, '', '', ], 'primary_key' => 'msgnum', 'unique' => [ ], @@ -6306,6 +6367,26 @@ sub tables_hashref { ], }, + 'msg_template_http' => { + 'columns' => [ + 'num', 'serial', '', '', '', '', + 'msgnum', 'int', '', '', '', '', + 'prepare_url', 'varchar', 'NULL', 255, '', '', + 'send_url', 'varchar', 'NULL', 255, '', '', + 'username', 'varchar', 'NULL', $char_d, '', '', + 'password', 'varchar', 'NULL', $char_d, '', '', + 'content', 'text', 'NULL', '', '', '', + ], + 'primary_key' => 'num', + 'unique' => [ [ 'msgnum' ], ], + 'index' => [ ], + 'foreign_keys' => [ + { columns => [ 'msgnum' ], + table => 'msg_template', + }, + ], + }, + 'template_content' => { 'columns' => [ 'contentnum', 'serial', '', '', '', '', @@ -6324,6 +6405,19 @@ sub tables_hashref { ], }, + 'template_image' => { + 'columns' => [ + 'imgnum', 'serial', '', '', '', '', + 'name', 'varchar', '', $char_d, '', '', + 'agentnum', 'int', 'NULL', '', '', '', + 'mime_type', 'varchar', '', $char_d, '', '', + 'base64', 'text', '', '', '', '', + ], + 'primary_key' => 'imgnum', + 'unique' => [ ], + 'index' => [ ['name'], ['agentnum'] ], + }, + 'cust_msg' => { 'columns' => [ 'custmsgnum', 'serial', '', '', '', '', @@ -6337,6 +6431,7 @@ sub tables_hashref { 'error', 'varchar', 'NULL', 255, '', '', 'status', 'varchar', '',$char_d, '', '', 'msgtype', 'varchar', 'NULL', 16, '', '', + 'preview', 'text', 'NULL', '', '', '', ], 'primary_key' => 'custmsgnum', 'unique' => [ ], @@ -6480,6 +6575,25 @@ sub tables_hashref { ], }, + 'log_email' => { + 'columns' => [ + 'logemailnum', 'serial', '', '', '', '', + 'context', 'varchar', 'NULL', $char_d, '', '', + 'min_level', 'int', 'NULL', '', '', '', + 'msgnum', 'int', '', '', '', '', + 'to_addr', 'varchar', 'NULL', 255, '', '', + ], + 'primary_key' => 'logemailnum', + 'unique' => [], + 'index' => [ ['context'], ['min_level'] ], + 'foreign_keys' => [ + { columns => [ 'msgnum' ], + table => 'msg_template', + references => [ 'msgnum' ], + }, + ], + }, + 'svc_alarm' => { 'columns' => [ # name type null length default local @@ -6902,6 +7016,8 @@ sub tables_hashref { 'latexsmallfooter', 'text', 'NULL', '', '', '', 'latexreturnaddress', 'text', 'NULL', '', '', '', 'with_latexcoupon', 'char', 'NULL', '1', '', '', + 'htmlwatermark', 'text', 'NULL', '', '', '', + 'latexwatermark', 'text', 'NULL', '', '', '', 'lpr', 'varchar', 'NULL', $char_d, '', '', ], 'primary_key' => 'confnum', @@ -6972,6 +7088,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', '', '', '', '', @@ -7003,7 +7120,7 @@ sub tables_hashref { 'blocknum', 'serial', '', '', '', '', 'zonenum', 'int', '', '', '', '', 'censusblock', 'char', '', 15, '', '', - 'censusyear', 'char', '', 4, '', '', + 'censusyear', 'char','NULL', 4, '', '', ], 'primary_key' => 'blocknum', 'unique' => [], @@ -7058,6 +7175,83 @@ sub tables_hashref { ], }, + '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' => {