]> git.mxchange.org Git - friendica.git/blobdiff - update.php
- Fixing SystemResource
[friendica.git] / update.php
index 40f39ebebad0783a07648d97f52abc4d870a63d6..145446bae0c6e79acee436efe340234998c0491b 100644 (file)
@@ -408,3 +408,25 @@ function update_1327()
        return Update::SUCCESS;
 }
 
+function update_1329()
+{
+       $currStorage = Config::get('storage', 'class', '');
+
+       if (!empty($currStorage)) {
+               $storageName = array_key_first(\Friendica\Core\StorageManager::DEFAULT_BACKENDS, $currStorage);
+               Config::set('storage', 'name', $storageName);
+               Config::delete('storage', 'class');
+       }
+
+       $photos = DBA::select('photos', ['backend-class', 'id'], ['backend-class IS NOT NULL']);
+       foreach ($photos as $photo) {
+               DBA::update('photos', ['backend-class' => $photo['backend-class']::NAME], ['id' => $photo['id']]);
+       }
+
+       $attachs = DBA::select('attach', ['backend-class', 'id'], ['backend-class IS NOT NULL']);
+       foreach ($attachs as $attach) {
+               DBA::update('photos', ['backend-class' => $attach['backend-class']::NAME], ['id' => $attach['id']]);
+       }
+
+       return Update::SUCCESS;
+}