X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=maintenance%2FpopulateRevisionSha1.php;h=89bfb85b4eac4a09e0dd82b0a07837b5a154e1f4;hb=af3f05e776404c71bb0aacf289b7249f442262d6;hp=382b7be4d8651d41869eb7a5f58071be9c2105e0;hpb=629df62ac2f8cc8639d9a470e2e6495b1aaf8f1b;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/populateRevisionSha1.php b/maintenance/populateRevisionSha1.php index 382b7be4d8..89bfb85b4e 100644 --- a/maintenance/populateRevisionSha1.php +++ b/maintenance/populateRevisionSha1.php @@ -22,7 +22,7 @@ * @ingroup Maintenance */ -require_once( __DIR__ . '/Maintenance.php' ); +require_once __DIR__ . '/Maintenance.php'; /** * Maintenance script that fills the rev_sha1 and ar_sha1 columns of revision @@ -48,6 +48,9 @@ class PopulateRevisionSha1 extends LoggedUpdateMaintenance { $this->error( "revision table does not exist", true ); } elseif ( !$db->tableExists( 'archive' ) ) { $this->error( "archive table does not exist", true ); + } elseif ( !$db->fieldExists( 'revision', 'rev_sha1', __METHOD__ ) ) { + $this->output( "rev_sha1 column does not exist\n\n", true ); + return false; } $this->output( "Populating rev_sha1 column\n" ); @@ -186,9 +189,9 @@ class PopulateRevisionSha1 extends LoggedUpdateMaintenance { array( 'ar_sha1' => Revision::base36Sha1( $text ) ), array( 'ar_namespace' => $row->ar_namespace, - 'ar_title' => $row->ar_title, + 'ar_title' => $row->ar_title, 'ar_timestamp' => $row->ar_timestamp, - 'ar_len' => $row->ar_len // extra sanity + 'ar_len' => $row->ar_len // extra sanity ), __METHOD__ ); @@ -198,4 +201,4 @@ class PopulateRevisionSha1 extends LoggedUpdateMaintenance { } $maintClass = "PopulateRevisionSha1"; -require_once( RUN_MAINTENANCE_IF_MAIN ); +require_once RUN_MAINTENANCE_IF_MAIN;