},
{
+ 'key' => 'queue-no_history',
+ 'section' => '',
+ 'description' => "Don't recreate the h_queue and h_queue_arg tables on upgrades. This can save disk space for large installs, especially when using prepaid or multi-process billing. After turning this option on, drop the h_queue and h_queue_arg tables, run freeside-dbdef-create and restart Apache and Freeside.",
+ 'type' => 'checkbox',
+ },
+
+ {
'key' => 'cancelled_cust-noevents',
'section' => 'billing',
'description' => "Don't run events for cancelled customers",
use DBIx::DBSchema::Table;
use DBIx::DBSchema::Column;
use DBIx::DBSchema::Index;
+#can't use this yet, dependency bs #use FS::Conf;
@ISA = qw(Exporter);
@EXPORT_OK = qw( dbdef dbdef_dist reload_dbdef );
=cut
sub dbdef_dist {
- my $datasrc = @_ ? shift : '';
+ my $datasrc = @_ && !ref($_[0]) ? shift : '';
+ my $opt = @_ ? shift : {};
my $local_options = '';
if ( $datasrc =~ /^dbi:mysql/i ) {
grep { ! /^(clientapi|access_user)_session/
&& ! /^h_/
&& ! /^log(_context)?$/
+ && ( ! /^queue(_arg)?$/ || ! $opt->{'queue-no_history'} )
&& ! $tables_hashref_torrus->{$_}
}
$dbdef->tables
#from 1.3 to 1.4... if not, it needs to be hooked into -upgrade here or
#you'll lose all the part_svc settings it migrates to part_svc_column
-my @statements = dbdef->sql_update_schema( dbdef_dist(datasrc),
+my $conf = new FS::Conf;
+
+my $dbdef_dist = dbdef_dist(
+ datasrc,
+ { 'queue-no_history' => $conf->exists('queue-no_history') },
+);
+
+my @statements = dbdef->sql_update_schema( $dbdef_dist,
$dbh,
{ 'nullify_default' => 1, },
);