bug 2083: requiring that the test database have a different name from the production database

This patch requires that the test database name be different from the production database name.
The object here is to prevent people from specifying the same database for both, and then
losing all of their data in the production database.

This may cause problems for people who want to do that, though I consider that bad practice.
It may also cause problems for people if they have two different servers, each with identically
named database, and they want to use one for testing and the other for production. If we ever
find that someone like that exists, we can deal with that case.

I don't think there are any necessary documentation changes here yet since we're recommending
that users answer "no" to the question about setting up a test database.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
Andrew Moore 2008-05-07 15:23:25 -05:00 committed by Joshua Ferraro
parent 4c8a9e14a8
commit 05b334d82b
1 changed files with 5 additions and 1 deletions

View File

@ -1094,7 +1094,11 @@ doing it in a database that you don't want to lose.
Please specify the name of the test database to be
used by Koha);
$config{'TEST_DB_NAME'} = _get_value('TEST_DB_NAME', $msg, $defaults->{'TEST_DB_NAME'}, $valid_values, $install_log_values);
$config{'TEST_DB_NAME'} = _get_value('TEST_DB_NAME', $msg, $defaults->{'TEST_DB_NAME'}, $valid_values, $install_log_values);
while ( $config{'TEST_DB_NAME'} eq $config{'DB_NAME'} ) {
$msg = q(Please do not use the same database for testing as you do for production. You run the severe risk of data loss.);
$config{'TEST_DB_NAME'} = _get_value('TEST_DB_NAME', $msg, $defaults->{'TEST_DB_NAME'}, $valid_values, $install_log_values);
}
$msg = q(
Please specify the user that owns the database to be