also repair storage id

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2021-01-22 16:05:14 +01:00
parent 291b72ec50
commit 8bd39f081f
No known key found for this signature in database
GPG Key ID: 42B69D8A64526EFB
1 changed files with 3 additions and 0 deletions

View File

@ -62,6 +62,7 @@ class RepairTree extends Command {
$query->update('filecache') $query->update('filecache')
->set('path', $query->createParameter('path')) ->set('path', $query->createParameter('path'))
->set('path_hash', $query->func()->md5($query->createParameter('path'))) ->set('path_hash', $query->func()->md5($query->createParameter('path')))
->set('storage', $query->createParameter('storage'))
->where($query->expr()->eq('fileid', $query->createParameter('fileid'))); ->where($query->expr()->eq('fileid', $query->createParameter('fileid')));
foreach ($rows as $row) { foreach ($rows as $row) {
@ -71,6 +72,7 @@ class RepairTree extends Command {
$query->setParameters([ $query->setParameters([
'fileid' => $row['fileid'], 'fileid' => $row['fileid'],
'path' => $row['parent_path'] . '/' . $row['name'], 'path' => $row['parent_path'] . '/' . $row['name'],
'storage' => $row['parent_storage'],
]); ]);
$query->execute(); $query->execute();
} }
@ -88,6 +90,7 @@ class RepairTree extends Command {
$query->select('f.fileid', 'f.path', 'f.parent', 'f.name') $query->select('f.fileid', 'f.path', 'f.parent', 'f.name')
->selectAlias('p.path', 'parent_path') ->selectAlias('p.path', 'parent_path')
->selectAlias('p.storage', 'parent_storage')
->from('filecache', 'f') ->from('filecache', 'f')
->innerJoin('f', 'filecache', 'p', $query->expr()->eq('f.parent', 'p.fileid')) ->innerJoin('f', 'filecache', 'p', $query->expr()->eq('f.parent', 'p.fileid'))
->where($query->expr()->orX( ->where($query->expr()->orX(