use Friendica\Core\Logger;
use Friendica\Core\Update;
use Friendica\Core\Worker;
+use Friendica\Database\Database;
use Friendica\Database\DBA;
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;
function update_1347()
{
foreach (Item::ACTIVITIES as $index => $activity) {
- DBA::insert('verb', ['id' => $index + 1, 'name' => $activity], true);
+ DBA::insert('verb', ['id' => $index + 1, 'name' => $activity], Database::INSERT_IGNORE);
}
return Update::SUCCESS;
{
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;
}
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;
+}