From: Hypolite Petovan Date: Fri, 13 Nov 2020 10:05:52 +0000 (-0500) Subject: [Database version 1375] Add update method to populate missing item.thr-parent values X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c98da630413b5c420d624f1895de57b5c15a1be4;p=friendica.git [Database version 1375] Add update method to populate missing item.thr-parent values --- diff --git a/static/dbstructure.config.php b/static/dbstructure.config.php index d1da024126..2905501747 100644 --- a/static/dbstructure.config.php +++ b/static/dbstructure.config.php @@ -54,7 +54,7 @@ use Friendica\Database\DBA; if (!defined('DB_UPDATE_VERSION')) { - define('DB_UPDATE_VERSION', 1374); + define('DB_UPDATE_VERSION', 1375); } return [ diff --git a/update.php b/update.php index 37cccd768d..460fad885c 100644 --- a/update.php +++ b/update.php @@ -749,3 +749,12 @@ function pre_update_1365() return Update::SUCCESS; } + +function update_1375() +{ + if (!DBA::e("UPDATE `item` SET `thr-parent` = `parent-uri`, `thr-parent-id` = `parent-uri-id` WHERE `thr-parent` = ''")) { + return Update::FAILED; + } + + return Update::SUCCESS; +}