1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
#!/usr/bin/perl -w
BEGIN {
$libpath = $0;
$libpath =~ s!/[^/]+$!!;
$libpath =~ s!/bin$!/lib/pronto!;
if (! -e $libpath) { die "Can't find required files in $libpath"; };
}
use lib "$libpath";
use lib "$libpath/modules/lib/perl5/site_perl/5.005";
use DBI;
require 'prontolib.pl';
&read_prefs;
my $dbh=&open_db_conn;
if ($prefs{'DatabaseDriver'} eq "Pg") {
$sth1 = $dbh->prepare("alter table boxlist add column query text");
$sth2 = $dbh->prepare("alter table boxlist add column body text");
} elsif ($prefs{'DatabaseDriver'} eq "mysql") {
$sth1 = $dbh->prepare("alter table boxlist add query text");
$sth2 = $dbh->prepare("alter table boxlist add body text");
} elsif ($prefs{'DatabaseDriver'} eq "CSV") { print("CSV driver\n"); }
if ($prefs{'DatabaseDriver'} eq "Pg" or $prefs{'DatabaseDriver'} eq "mysql") {
$sth1->execute;
$sth2->execute;
}
elsif ($prefs{'DataBaseDriver'} eq "CSV") { print("Because you are using CSV as a Database,
you will have to modify the ~/.cscmail/boxlist file by hand and insert the
query and body fields manually !");
}
|