diff --git a/misc-scripts/production_database/scripts/update_database_list.pl b/misc-scripts/production_database/scripts/update_database_list.pl index 03904099e15333e525ce181999c57c6fa132ebd9..f21b69b8403f26d16906641f41727e83479d3e18 100755 --- a/misc-scripts/production_database/scripts/update_database_list.pl +++ b/misc-scripts/production_database/scripts/update_database_list.pl @@ -155,18 +155,19 @@ my %found_databases; { my $statement = - 'SELECT full_db_name ' + 'SELECT full_db_name, db_release ' . 'FROM db_list JOIN db USING (db_id) ' . 'WHERE db.is_current = 1'; my $sth = $dbh->prepare($statement); $sth->execute(); - my $database; + my ($database, $db_release); $sth->bind_col( 1, \$database ); + $sth->bind_col( 2, \$db_release ); while ( $sth->fetch() ) { - $existing_databases{$database} = 1; + $existing_databases{$database} = $db_release; } } @@ -300,7 +301,11 @@ if ( scalar( keys(%existing_databases) ) != print("The following databases seem to have disappeared:\n"); foreach my $db_name ( sort keys(%existing_databases) ) { + my $db_release = $existing_databases{$db_name}; if ( !exists( $found_databases{$db_name} ) ) { + if($db_release != $release) { + next; #if db release not same as the current one then skip + } printf( "\t%s. Remove this database? (y/N): ", $db_name ); my $yesno = <STDIN>; chomp($yesno);