@@ -24,7 +24,6 @@ |
||
| 24 | 24 | use OCP\Migration\IOutput; |
| 25 | 25 | use OCP\Migration\IRepairStep; |
| 26 | 26 | use Doctrine\DBAL\Platforms\MySqlPlatform; |
| 27 | -use OCP\DB\QueryBuilder\IQueryBuilder; |
|
| 28 | 27 | use Doctrine\DBAL\Platforms\OraclePlatform; |
| 29 | 28 | use OCP\Files\IMimeTypeLoader; |
| 30 | 29 | use OCP\IDBConnection; |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | * @param string $wrongPath wrong path of the entry to fix |
| 97 | 97 | * @param int $correctStorageNumericId numeric idea of the correct storage |
| 98 | 98 | * @param string $correctPath value to which to set the path of the entry |
| 99 | - * @return bool true for success |
|
| 99 | + * @return boolean|null true for success |
|
| 100 | 100 | */ |
| 101 | 101 | private function fixEntryPath(IOutput $out, $fileId, $wrongPath, $correctStorageNumericId, $correctPath) { |
| 102 | 102 | // delete target if exists |
@@ -121,6 +121,9 @@ discard block |
||
| 121 | 121 | $out->advance(1, $text); |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | + /** |
|
| 125 | + * @param IQueryBuilder $qb |
|
| 126 | + */ |
|
| 124 | 127 | private function addQueryConditionsParentIdWrongPath($qb, $storageNumericId) { |
| 125 | 128 | // thanks, VicDeo! |
| 126 | 129 | if ($this->connection->getDatabasePlatform() instanceof MySqlPlatform) { |
@@ -160,6 +163,9 @@ discard block |
||
| 160 | 163 | } |
| 161 | 164 | } |
| 162 | 165 | |
| 166 | + /** |
|
| 167 | + * @param IQueryBuilder $qb |
|
| 168 | + */ |
|
| 163 | 169 | private function addQueryConditionsNonExistingParentIdEntry($qb, $storageNumericId = null) { |
| 164 | 170 | // Subquery for parent existence |
| 165 | 171 | $qbe = $this->connection->getQueryBuilder(); |
@@ -189,6 +195,9 @@ discard block |
||
| 189 | 195 | } |
| 190 | 196 | } |
| 191 | 197 | |
| 198 | + /** |
|
| 199 | + * @param integer $storageNumericId |
|
| 200 | + */ |
|
| 192 | 201 | private function countResultsToProcessParentIdWrongPath($storageNumericId = null) { |
| 193 | 202 | $qb = $this->connection->getQueryBuilder(); |
| 194 | 203 | $qb->select($qb->createFunction('COUNT(*)')); |
@@ -199,6 +208,9 @@ discard block |
||
| 199 | 208 | return $count; |
| 200 | 209 | } |
| 201 | 210 | |
| 211 | + /** |
|
| 212 | + * @param integer $storageNumericId |
|
| 213 | + */ |
|
| 202 | 214 | private function countResultsToProcessNonExistingParentIdEntry($storageNumericId = null) { |
| 203 | 215 | $qb = $this->connection->getQueryBuilder(); |
| 204 | 216 | $qb->select($qb->createFunction('COUNT(*)')); |
@@ -347,6 +359,7 @@ discard block |
||
| 347 | 359 | * |
| 348 | 360 | * @param int $storageId storage id |
| 349 | 361 | * @param string $path path for which to create the parent entry |
| 362 | + * @param integer $reuseFileId |
|
| 350 | 363 | * @return int file id of the newly created parent |
| 351 | 364 | */ |
| 352 | 365 | private function getOrCreateEntry($storageId, $path, $reuseFileId = null) { |