catch error if old filecache table is not present during upgrade
This commit is contained in:
parent
98f42d314c
commit
317cd4c70a
|
@ -15,13 +15,17 @@ class Upgrade {
|
|||
$insertQuery = \OC_DB::prepare('INSERT INTO `*PREFIX*filecache`( `fileid`, `storage`, `path`, `path_hash`, `parent`, `name`, `mimetype`, `mimepart`, `size`, `mtime`, `encrypted` )
|
||||
VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)');
|
||||
|
||||
try {
|
||||
$oldEntriesQuery = \OC_DB::prepare('SELECT * FROM `*PREFIX*fscache` ORDER BY `id` ASC'); //sort ascending to ensure the parent gets inserted before a child
|
||||
try{
|
||||
$oldEntriesResult = $oldEntriesQuery->execute();
|
||||
}catch(\Exception $e){
|
||||
} catch (\Exception $e) {
|
||||
return;
|
||||
}
|
||||
if(!$oldEntriesResult){
|
||||
try {
|
||||
$oldEntriesResult = $oldEntriesQuery->execute();
|
||||
} catch (\Exception $e) {
|
||||
return;
|
||||
}
|
||||
if (!$oldEntriesResult) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue