Issue 9977: Check for the existance of the "item" table on postupdate
authorMichael <heluecht@pirati.ca>
Thu, 4 Mar 2021 00:00:24 +0000 (00:00 +0000)
committerMichael <heluecht@pirati.ca>
Thu, 4 Mar 2021 00:00:24 +0000 (00:00 +0000)
src/Database/PostUpdate.php

index 232ee18..9659a86 100644 (file)
@@ -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)]);