mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-07 11:14:32 +02:00
[Database 1525] Deprecate profile.name in favor of user.username
This commit is contained in:
parent
e31d90eadb
commit
38f04616d2
4 changed files with 32 additions and 5 deletions
27
update.php
27
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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue