]> git.mxchange.org Git - friendica.git/blobdiff - src/Database/PostUpdate.php
Issue 10392: Avoid "Friendica can't display this page at the moment"
[friendica.git] / src / Database / PostUpdate.php
index f36ae4f62b31b8d6f8ac7c1956163ff68fbafb75..3e2627b9a9f5f585fd06af4fef7f9244d5f79172 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
  *
@@ -45,7 +45,7 @@ class PostUpdate
 {
        // Needed for the helper function to read from the legacy term table
        const OBJECT_TYPE_POST  = 1;
-       const VERSION = 1384;
+       const VERSION = 1400;
 
        /**
         * Calls the post update functions
@@ -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)]);
 
@@ -804,7 +809,7 @@ class PostUpdate
                Logger::info('Processed', ['rows' => $rows]);
 
                if ($rows <= 100) {
-                       DI::config()->set("system", "post_update_version", 1384);
+                       DI::config()->set("system", "post_update_version", 1400);
                        Logger::info('Done');
                        return true;
                }