From 05b334d82b62d83f31ec82eb80cce2581764304c Mon Sep 17 00:00:00 2001 From: Andrew Moore Date: Wed, 7 May 2008 15:23:25 -0500 Subject: [PATCH] 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 --- Makefile.PL | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile.PL b/Makefile.PL index bae8dbc79a..bd0ea5831c 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -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 -- 2.20.1