X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=update.php;h=9af01fd0fe36fbe2d460f30ad590ef19ea52a1eb;hb=15fc205d04d18f08954c4db94e532a9bf559b8a7;hp=78295921a14faf9461494342a7bd84488cb1f2a8;hpb=fe48fcf9decfe9364f4f303d1ce4314f049a9cd6;p=friendica.git diff --git a/update.php b/update.php index 78295921a1..9af01fd0fe 100644 --- a/update.php +++ b/update.php @@ -62,6 +62,7 @@ use Friendica\Model\User; use Friendica\Protocol\Activity; use Friendica\Protocol\Delivery; use Friendica\Security\PermissionSet\Repository\PermissionSet; +use Friendica\Util\DateTimeFormat; // Post-update script of PR 5751 function update_1298() @@ -1356,7 +1357,8 @@ function update_1525(): int if (!DBA::e('UPDATE `user` u JOIN `profile` p ON p.`uid` = u.`uid` - SET u.`username` = p.`name`')) { + SET u.`username` = p.`name` + WHERE p.`name` != ""')) { return Update::FAILED; } @@ -1376,3 +1378,15 @@ function update_1525(): int return Update::SUCCESS; } + +function update_1531() +{ + $threads = Post::selectThread(Item::DELIVER_FIELDLIST, ["`uid` = ? AND `created` > ?", 0, DateTimeFormat::utc('now - ' . DI::config()->get('channel', 'engagement_hours') . ' hour')]); + while ($post = Post::fetch($threads)) { + $post['gravity'] = Item::GRAVITY_COMMENT; + Post\Engagement::storeFromItem($post); + } + DBA::close($threads); + + return Update::SUCCESS; +} \ No newline at end of file