X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=update.php;h=81e5be8d649875be0c76d4810003ba5cc909e72f;hb=107cc6f297b8af88b2fd3d4b382e6cc80edfec69;hp=368b70b228bb26a76dcbbea9c0b1841e09873147;hpb=2ab0d06996410f68cf501e6e2014bf4829b121ae;p=friendica.git diff --git a/update.php b/update.php index 368b70b228..81e5be8d64 100644 --- a/update.php +++ b/update.php @@ -1000,14 +1000,6 @@ function update_1434() return Update::SUCCESS; } -function update_1435() -{ - $contacts = DBA::select('contact', [], ["`uid` != ?", 0]); - while ($contact = DBA::fetch($contacts)) { - Contact\User::insertForContactArray($contact); - } -} - function update_1438() { DBA::update('photo', ['photo-type' => Photo::USER_AVATAR], ['profile' => true]); @@ -1061,3 +1053,20 @@ function update_1442() return Update::SUCCESS; } + +/** + * A bug in Contact\User::updateByContactUpdate prevented any update to the user-contact table since the rows have been + * created in version 1435. This version fixes this bug but the user-contact rows are outdated, we need to regenerate + * them. + */ +function update_1444() +{ + DBA::e('TRUNCATE TABLE `user-contact`'); + + $contacts = DBA::select('contact', [], ["`uid` != ?", 0]); + while ($contact = DBA::fetch($contacts)) { + Contact\User::insertForContactArray($contact); + } + + return Update::SUCCESS; +}