[Database version 1375] Add update method to populate missing item.thr-parent values

This commit is contained in:
Hypolite Petovan 2020-11-13 05:05:52 -05:00
parent 2e7c505ac0
commit c98da63041
2 changed files with 10 additions and 1 deletions

View file

@ -54,7 +54,7 @@
use Friendica\Database\DBA; use Friendica\Database\DBA;
if (!defined('DB_UPDATE_VERSION')) { if (!defined('DB_UPDATE_VERSION')) {
define('DB_UPDATE_VERSION', 1374); define('DB_UPDATE_VERSION', 1375);
} }
return [ return [

View file

@ -749,3 +749,12 @@ function pre_update_1365()
return Update::SUCCESS; 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;
}