]> git.mxchange.org Git - friendica.git/blobdiff - src/Database/PostUpdate.php
Merge branch 'stable' into develop
[friendica.git] / src / Database / PostUpdate.php
index 232ee1881353ca95b264107d2c0b47ca80a2cc82..ab72848ffaf6b87a831e7fee7a2b7f0400f9bab3 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -740,7 +740,7 @@ class PostUpdate
                Logger::info('Start', ['rest' => DBA::count('photo', $condition)]);
 
                $rows = 0;
-               $photos = DBA::select('photo', [], $condition, ['limit' => 10000]);
+               $photos = DBA::select('photo', [], $condition, ['limit' => 100]);
 
                if (DBA::errorNo() != 0) {
                        Logger::error('Database error', ['no' => DBA::errorNo(), 'message' => DBA::errorMessage()]);
@@ -784,6 +784,11 @@ class PostUpdate
                        return true;
                }
 
+               if (!DBStructure::existsTable('item')) {
+                       DI::config()->set("system", "post_update_version", 1400);
+                       return true;
+               }
+
                $condition = ["`extid` != ? AND EXISTS(SELECT `id` FROM `post-user` WHERE `uri-id` = `item`.`uri-id` AND `uid` = `item`.`uid` AND `external-id` IS NULL)", ''];
                Logger::info('Start', ['rest' => DBA::count('item', $condition)]);