$table = 'filearchive';
$conds = array( 'fa_sha1' => '', 'fa_storage_key IS NOT NULL' );
$this->output( "Populating fa_sha1 field from fa_storage_key\n" );
- $endId = $dbw->selectField( $table, 'MAX(fa_id)', false, __METHOD__ );\r
+ $endId = $dbw->selectField( $table, 'MAX(fa_id)', false, __METHOD__ );
$batchSize = $this->mBatchSize;
$done = 0;
$i = 0;
foreach ( $res as $row ) {
+ if ( $row->fa_storage_key == '' ) {
+ // Revision was missing pre-deletion
+ continue;
+ }
$sha1 = LocalRepo::getHashFromKey( $row->fa_storage_key );
$dbw->update( $table,
array( 'fa_sha1' => $sha1 ),