X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=update.php;h=78295921a14faf9461494342a7bd84488cb1f2a8;hb=2ba3069b073ecf1483c9028d017ab881b5c8a3a4;hp=980ec721ab281db90676eab2cb59e03953c3f730;hpb=a2fce0e89db895b278df787ea1a4915fc2035a5d;p=friendica.git diff --git a/update.php b/update.php index 980ec721ab..78295921a1 100644 --- a/update.php +++ b/update.php @@ -1349,3 +1349,30 @@ function update_1524(): int return Update::SUCCESS; } + +function update_1525(): int +{ + // Use expected value for user.username + if (!DBA::e('UPDATE `user` u + JOIN `profile` p + ON p.`uid` = u.`uid` + SET u.`username` = p.`name`')) { + return Update::FAILED; + } + + // Blank out deprecated field profile.name to avoid future confusion + if (!DBA::e('UPDATE `profile` p + SET p.`name` = ""')) { + return Update::FAILED; + } + + // Update users' self-contact name if needed + if (!DBA::e('UPDATE `contact` c + JOIN `user` u + ON u.`uid` = c.`uid` AND c.`self` = 1 + SET c.`name` = u.`username`')) { + return Update::FAILED; + } + + return Update::SUCCESS; +}