From: Greg Sabino Mullane Date: Fri, 28 Sep 2007 14:03:06 +0000 (+0000) Subject: Use same typnames as schema for ease. Put added column before column type checks. X-Git-Tag: 1.31.0-rc.0~51256 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=commitdiff_plain;h=12bea7a9d5394bbad920278e74a6375ebe480d94;p=lhc%2Fweb%2Fwiklou.git Use same typnames as schema for ease. Put added column before column type checks. --- diff --git a/includes/DatabasePostgres.php b/includes/DatabasePostgres.php index 3bc36f3431..143443771f 100644 --- a/includes/DatabasePostgres.php +++ b/includes/DatabasePostgres.php @@ -16,7 +16,12 @@ class PostgresField { global $wgDBmwschema; $q = <<query("ALTER TABLE $nc[0] ADD $nc[1] $nc[2]"); } + ## Needed before column changes + if (is_null($wgDatabase->fieldInfo("archive", "ar_deleted"))) { + echo "... add archive.ar_deleted\n"; + dbsource(archive("patch-archive-ar_deleted.sql")); + } else + echo "... archive.ar_deleted already exists\n"; + foreach ($typechanges as $tc) { $fi = $wgDatabase->fieldInfo($tc[0], $tc[1]); if (is_null($fi)) { @@ -1455,7 +1462,7 @@ function do_postgres_updates() { } } - if ($wgDatabase->fieldInfo('oldimage','oi_deleted') !== 'smallint') { + if ($wgDatabase->fieldInfo('oldimage','oi_deleted')->type() !== 'smallint') { echo "... change oldimage.oi_deleted to smallint"; $wgDatabase->query("ALTER TABLE oldimage ALTER oi_deleted DROP DEFAULT"); $wgDatabase->query("ALTER TABLE oldimage ALTER oi_deleted TYPE SMALLINT USING (oi_deleted::smallint)"); @@ -1518,12 +1525,6 @@ function do_postgres_updates() { dbsource(archive('patch-revision_rev_user_fkey.sql')); } - if (is_null($wgDatabase->fieldInfo("archive", "ar_deleted"))) { - echo "... add archive.ar_deleted\n"; - dbsource(archive("patch-archive-ar_deleted.sql")); - } else - echo "... archive.ar_deleted already exists\n"; - global $wgExtNewTables, $wgExtPGNewFields, $wgExtNewIndexes; # Add missing extension tables foreach ( $wgExtNewTables as $nt ) {