From: Hypolite Petovan Date: Sat, 27 May 2023 22:19:41 +0000 (-0400) Subject: [Database version 1520] Reset user.parent-uid to null if it is set to zero X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=0a738c8ce3965da40016771658b7bda116576eee;p=friendica.git [Database version 1520] Reset user.parent-uid to null if it is set to zero --- diff --git a/database.sql b/database.sql index 697f250fee..d61a3eda5a 100644 --- a/database.sql +++ b/database.sql @@ -1,6 +1,6 @@ -- ------------------------------------------ -- Friendica 2023.09-dev (Giant Rhubarb) --- DB_UPDATE_VERSION 1519 +-- DB_UPDATE_VERSION 1520 -- ------------------------------------------ diff --git a/static/dbstructure.config.php b/static/dbstructure.config.php index 1b3e348759..8ff6604121 100644 --- a/static/dbstructure.config.php +++ b/static/dbstructure.config.php @@ -54,8 +54,9 @@ use Friendica\Database\DBA; +// This file is required several times during the test in DbaDefinition which justifies this condition if (!defined('DB_UPDATE_VERSION')) { - define('DB_UPDATE_VERSION', 1519); + define('DB_UPDATE_VERSION', 1520); } return [ diff --git a/update.php b/update.php index 3cd0a45a7b..14219bcdcb 100644 --- a/update.php +++ b/update.php @@ -1326,3 +1326,10 @@ function update_1518() return Update::SUCCESS; } + +function update_1520(): int +{ + DBA::update('user', ['parent-uid' => null], ['parent-uid' => 0]); + + return Update::SUCCESS; +}