]> git.mxchange.org Git - friendica.git/blobdiff - src/Database/PostUpdate.php
Merge remote-tracking branch 'upstream/develop' into contact-tabs
[friendica.git] / src / Database / PostUpdate.php
index 6d8b197db145def8d7117cf3ed0b66d47edba589..6a8d663c5a8ae14e79b76ddcf735707a6efcb53f 100644 (file)
@@ -93,9 +93,6 @@ class PostUpdate
                if (!self::update1349()) {
                        return false;
                }
-               if (!self::update1350()) {
-                       return false;
-               }
 
                return true;
        }
@@ -997,57 +994,4 @@ class PostUpdate
 
                return false;
        }
-
-       /**
-        * update the "gsid" (global server id) field in the gcontact table
-        *
-        * @return bool "true" when the job is done
-        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
-        * @throws \ImagickException
-        */
-       private static function update1350()
-       {
-               // Was the script completed?
-               if (DI::config()->get("system", "post_update_version") >= 1350) {
-                       return true;
-               }
-
-               $id = DI::config()->get("system", "post_update_version_1350_id", 0);
-
-               Logger::info('Start', ['gcontact' => $id]);
-
-               $start_id = $id;
-               $rows = 0;
-               $condition = ["`id` > ? AND `gsid` IS NULL AND `server_url` != '' AND NOT `server_url` IS NULL", $id];
-               $params = ['order' => ['id'], 'limit' => 10000];
-               $gcontacts = DBA::select('gcontact', ['id', 'server_url'], $condition, $params);
-
-               if (DBA::errorNo() != 0) {
-                       Logger::error('Database error', ['no' => DBA::errorNo(), 'message' => DBA::errorMessage()]);
-                       return false;
-               }
-
-               while ($gcontact = DBA::fetch($gcontacts)) {
-                       $id = $gcontact['id'];
-
-                       DBA::update('gcontact',
-                               ['gsid' => GServer::getID($gcontact['server_url'], true), 'server_url' => GServer::cleanURL($gcontact['server_url'])],
-                               ['id' => $gcontact['id']]);
-
-                       ++$rows;
-               }
-               DBA::close($gcontacts);
-
-               DI::config()->set("system", "post_update_version_1350_id", $id);
-
-               Logger::info('Processed', ['rows' => $rows, 'last' => $id]);
-
-               if ($start_id == $id) {
-                       DI::config()->set("system", "post_update_version", 1350);
-                       Logger::info('Done');
-                       return true;
-               }
-
-               return false;
-       }
 }