From c7f9eaf626f20ff3b667eda8766105d9f4c42a22 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Wed, 10 Nov 2010 16:06:16 +0000 Subject: [PATCH] Postgres updater stuff, needs review * Move setup_database() from DatabasePostgres to PostgresInstaller ** Add install step after interwiki for the COMMIT ** Put the table creation test (should we abstract this?) in setupDatabase() ** The leftover stuff in initial_setup() also belongs in setupDatabase(), I think? --- includes/db/DatabasePostgres.php | 51 ------------------------ includes/installer/DatabaseInstaller.php | 3 +- includes/installer/Installer.i18n.php | 1 + includes/installer/PostgresInstaller.php | 35 ++++++++++++++++ 4 files changed, 38 insertions(+), 52 deletions(-) diff --git a/includes/db/DatabasePostgres.php b/includes/db/DatabasePostgres.php index 16b558bca8..fe557d1db0 100644 --- a/includes/db/DatabasePostgres.php +++ b/includes/db/DatabasePostgres.php @@ -1275,57 +1275,6 @@ SQL; return $sql; } - function setup_database() { - global $wgDBmwschema, $wgDBuser; - - // Make sure that we can write to the correct schema - // If not, Postgres will happily and silently go to the next search_path item - $ctest = 'mediawiki_test_table'; - $safeschema = $this->quote_ident( $wgDBmwschema ); - if ( $this->tableExists( $ctest, $wgDBmwschema ) ) { - $this->doQuery( "DROP TABLE $safeschema.$ctest" ); - } - $SQL = "CREATE TABLE $safeschema.$ctest(a int)"; - $olde = error_reporting( 0 ); - $res = $this->doQuery( $SQL ); - error_reporting( $olde ); - if ( !$res ) { - print 'FAILED. Make sure that the user "' . htmlspecialchars( $wgDBuser ) . - '" can write to the schema "' . htmlspecialchars( $wgDBmwschema ) . "\"\n"; - dieout( '' ); # Will close the main list