From: Chad Horohoe Date: Wed, 10 Nov 2010 16:06:16 +0000 (+0000) Subject: Postgres updater stuff, needs review X-Git-Tag: 1.31.0-rc.0~33942 X-Git-Url: http://git.cyclocoop.org//%27%40script%40/%27?a=commitdiff_plain;h=c7f9eaf626f20ff3b667eda8766105d9f4c42a22;p=lhc%2Fweb%2Fwiklou.git 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? --- 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