From: Sam Reed Date: Wed, 12 Jan 2011 02:16:56 +0000 (+0000) Subject: Follwup r75575, honour table prefixes. Bad Roan ;) X-Git-Tag: 1.31.0-rc.0~32604 X-Git-Url: http://git.cyclocoop.org/wiki/Target_page?a=commitdiff_plain;h=4906d5091161bd6041958d1f6ad36517b632030e;p=lhc%2Fweb%2Fwiklou.git Follwup r75575, honour table prefixes. Bad Roan ;) --- diff --git a/maintenance/cleanupRemovedModules.php b/maintenance/cleanupRemovedModules.php index f89acb2eb7..a4261f9348 100644 --- a/maintenance/cleanupRemovedModules.php +++ b/maintenance/cleanupRemovedModules.php @@ -44,10 +44,11 @@ class CleanupRemovedModules extends Maintenance { $this->output( "Cleaning up module_deps table...\n" ); $i = 1; + $modDeps = $dbw->tableName( 'module_deps' ); do { // $dbw->delete() doesn't support LIMIT :( $where = $moduleList ? "md_module NOT IN ($moduleList)" : '1=1'; - $dbw->query( "DELETE FROM module_deps WHERE $where LIMIT $limit", __METHOD__ ); + $dbw->query( "DELETE FROM $modDeps WHERE $where LIMIT $limit", __METHOD__ ); $numRows = $dbw->affectedRows(); $this->output( "Batch $i: $numRows rows\n" ); $i++; @@ -57,9 +58,11 @@ class CleanupRemovedModules extends Maintenance { $this->output( "Cleaning up msg_resource table...\n" ); $i = 1; + + $mrRes = $dbw->tableName( 'mr_resource' ); do { $where = $moduleList ? "mr_resource NOT IN ($moduleList)" : '1=1'; - $dbw->query( "DELETE FROM msg_resource WHERE $where LIMIT $limit", __METHOD__ ); + $dbw->query( "DELETE FROM $mrRes WHERE $where LIMIT $limit", __METHOD__ ); $numRows = $dbw->affectedRows(); $this->output( "Batch $i: $numRows rows\n" ); $i++; @@ -69,9 +72,10 @@ class CleanupRemovedModules extends Maintenance { $this->output( "Cleaning up msg_resource_links table...\n" ); $i = 1; + $msgRes = $dbw->tableName( 'mr_resource_links' ); do { $where = $moduleList ? "mrl_resource NOT IN ($moduleList)" : '1=1'; - $dbw->query( "DELETE FROM msg_resource_links WHERE $where LIMIT $limit", __METHOD__ ); + $dbw->query( "DELETE FROM $msgRes WHERE $where LIMIT $limit", __METHOD__ ); $numRows = $dbw->affectedRows(); $this->output( "Batch $i: $numRows rows\n" ); $i++;