]> git.mxchange.org Git - friendica.git/blobdiff - update.php
IT translations 100% THX Sylke Vicious
[friendica.git] / update.php
index c3c83b937b9116609e20dbb16761760fff3a5e00..285252770a36090e3930655a299db8f43b2507d0 100644 (file)
@@ -50,6 +50,7 @@ use Friendica\Database\DBStructure;
 use Friendica\DI;
 use Friendica\Model\Contact;
 use Friendica\Model\Item;
+use Friendica\Model\Notify;
 use Friendica\Model\Photo;
 use Friendica\Model\User;
 use Friendica\Model\Storage;
@@ -802,10 +803,6 @@ function pre_update_1377()
 {
        DBStructure::checkInitialValues();
 
-       if (!DBA::e("DELETE FROM `item` WHERE NOT `parent` IN (SELECT `id` FROM `item`)")) {
-               return Update::FAILED;
-       }
-
        if (!DBA::e("DELETE FROM `item` WHERE NOT `author-id` IN (SELECT `id` FROM `contact`)")) {
                return Update::FAILED;
        }
@@ -860,3 +857,18 @@ function pre_update_1377()
 
        return Update::SUCCESS;
 }
+
+function update_1380()
+{
+       if (!DBA::e("UPDATE `notify` INNER JOIN `item` ON `item`.`id` = `notify`.`iid` SET `notify`.`uri-id` = `item`.`uri-id` WHERE `notify`.`uri-id` IS NULL AND `notify`.`otype` IN (?, ?)",
+               Notify\ObjectType::ITEM, Notify\ObjectType::PERSON)) {
+               return Update::FAILED;
+       }
+
+       if (!DBA::e("UPDATE `notify` INNER JOIN `item` ON `item`.`id` = `notify`.`parent` SET `notify`.`parent-uri-id` = `item`.`uri-id` WHERE `notify`.`parent-uri-id` IS NULL AND `notify`.`otype` IN (?, ?)",
+               Notify\ObjectType::ITEM, Notify\ObjectType::PERSON)) {
+               return Update::FAILED;
+       }
+
+       return Update::SUCCESS;
+}