\r
# Get "active" revisions from the filearchive table\r
echo( "Searching for and deleting archived files...\n" );\r
- $res = $dbw->query( "SELECT fa_storage_group,fa_storage_key FROM $tbl_arch" );\r
+ $res = $dbw->query( "SELECT fa_id,fa_storage_group,fa_storage_key FROM $tbl_arch" );\r
while( $row = $dbw->fetchObject( $res ) ) {\r
$key = $row->fa_storage_key;\r
$group = $row->fa_storage_group;\r
+ $id = $row->fa_id;\r
\r
$store = FileStore::get( $group );\r
if ( $store ) {\r
$path = $store->filePath( $key );\r
if ( $path && file_exists($path) ) {\r
$transaction->addCommit( FSTransaction::DELETE_FILE, $path );\r
+ $dbw->query( "DELETE FROM $tbl_arch WHERE fa_id = $id" );\r
} else {\r
echo( "Notice - file '$key' not found in group '$group'\n" );\r
}\r
\r
$transaction->commit();\r
\r
- \r
- # Delete as appropriate\r
- echo( "Deleting filearchive rows..." );\r
- $dbw->query( "TRUNCATE TABLE $tbl_arch" );\r
- echo( "done.\n" );\r
- \r
# This bit's done\r
# Purge redundant text records\r
$dbw->commit();\r