238 |
if ($options->{dbCreate}) { |
if ($options->{dbCreate}) { |
239 |
# Here we want to drop and re-create the database. |
# Here we want to drop and re-create the database. |
240 |
my $db = $FIG_Config::sproutDB; |
my $db = $FIG_Config::sproutDB; |
241 |
if ($FIG_Config::dbms eq "Pg") { |
DBKernel::CreateDB($db); |
|
my $dbport = $FIG_Config::dbport; |
|
|
my $dbuser = $FIG_Config::dbuser; |
|
|
Trace("Dropping old database (failure is okay).") if T(2); |
|
|
system("dropdb -p $dbport -U $dbuser $db"); |
|
|
Trace("Creating new database.") if T(2); |
|
|
&FIG::run("createdb -p $dbport -U $dbuser $db"); |
|
|
} elsif ($FIG_Config::dbms eq "mysql") { |
|
|
Trace("Dropping old database (failure is okay).") if T(2); |
|
|
system("mysqladmin -u $FIG_Config::dbuser -p drop $db"); |
|
|
&FIG::run("mysqladmin -u $FIG_Config::dbuser -p create $db"); |
|
|
Trace("Creating new database.") if T(2); |
|
|
} |
|
242 |
} |
} |
243 |
# Create the sprout loader object. Note that the Sprout object does not |
# Create the sprout loader object. Note that the Sprout object does not |
244 |
# open the database unless the "dbLoad" option is turned on. |
# open the database unless the "dbLoad" option is turned on. |