User:Woozle/Friendica/2017 upgrade: Difference between revisions
extracted `contact` to subpage; added `item` |
updated syntax highlighting tags |
||
| (5 intermediate revisions by the same user not shown) | |||
| Line 3: | Line 3: | ||
==Table Modifications== | ==Table Modifications== | ||
* [[/contact]] - this is the first one I did, so notes are more explanatory | * [[/contact]] - this is the first one I did, so notes are more explanatory | ||
* [[/item]] | * [[/item]] - this was a large table, and took a lot of time to do the copy | ||
* [[/gcontact]] | |||
* [[/notify]] | |||
==Other Changes== | |||
===acl_selectors=== | |||
This SQL:<source lang=mysql>SELECT `group`.`id`, `group`.`name`, GROUP_CONCAT(DISTINCT `group_member`.`contact-id` SEPARATOR ',') AS uids | |||
FROM `group` | |||
INNER JOIN `group_member` ON `group_member`.`gid`=`group`.`id` AND `group_member`.`uid` = `group`.`uid` | |||
WHERE NOT `group`.`deleted` AND `group`.`uid` = 1 | |||
GROUP BY `group`.`name` | |||
ORDER BY `group`.`name` | |||
LIMIT 0,100</source> | |||
...returned the following error: '''Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'icms-fka.group.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by'''. | |||
Finding where this was being generated required the use of [[grep]]:<source lang=bash>grep -r "GROUP BY \`group\`.\`name\`" *.php</source>Note that the -r option doesn't actually seem to work; I had to run this inside the "includes" folder to identify the file -- which turned out to be '''acl_selectors.php''' line 505, which I have modified thusly:<source lang=mysql>GROUP BY `group`.`name`, `group`.`id`</source> | |||
==Sticking Point== | |||
I finally got stuck -- or, perhaps I should say, decided/realized that the next step was too big of a time-investment -- when trying to figure out where and why this error was happening (reformatted slightly for readability): | |||
<pre> | |||
2017-04-08 19:33:18@wrk58e93afe0cd759.83335256 [NORMAL]:dba.php:289:q DB Error (Connected) 1050: Table 'temp-addon' already exists | |||
2017-04-08 19:33:18@wrk58e93afe0cd759.83335256 [NORMAL]:dba.php:328:q dba: CREATE TABLE `temp-addon` LIKE `addon`; returned false. | |||
Table 'temp-addon' already exists | |||
2017-04-08 19:33:18@wrk58e93afe0cd759.83335256 []:dbstructure.php:25:update_fail | |||
Cannot notify administrators about update_id=1216, error_message=Errors encountered performing database changes. | |||
ALTER TABLE `temp-addon` MODIFY `name` varchar(190) NOT NULL DEFAULT '', MODIFY `version` varchar(255) NOT NULL DEFAULT '', ADD UNIQUE INDEX `name` (`name`);<br /> | |||
</pre> | |||
I found where the error was being thrown, but would have to do some significant backtracing just to figure out what was executing the problematic SQL, and/or what was generating it... and, most importantly, ''why''. | |||
Latest revision as of 18:29, 12 October 2019
This isn't a complete description of everything I had to do in order to get the latest Friendica working with my existing data, but it shows how I solved some of the more thorny problems.
Table Modifications
- /contact - this is the first one I did, so notes are more explanatory
- /item - this was a large table, and took a lot of time to do the copy
- /gcontact
- /notify
Other Changes
acl_selectors
This SQL:
SELECT `group`.`id`, `group`.`name`, GROUP_CONCAT(DISTINCT `group_member`.`contact-id` SEPARATOR ',') AS uids
FROM `group`
INNER JOIN `group_member` ON `group_member`.`gid`=`group`.`id` AND `group_member`.`uid` = `group`.`uid`
WHERE NOT `group`.`deleted` AND `group`.`uid` = 1
GROUP BY `group`.`name`
ORDER BY `group`.`name`
LIMIT 0,100
...returned the following error: Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'icms-fka.group.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by.
Finding where this was being generated required the use of grep:
grep -r "GROUP BY \`group\`.\`name\`" *.php
Note that the -r option doesn't actually seem to work; I had to run this inside the "includes" folder to identify the file -- which turned out to be acl_selectors.php line 505, which I have modified thusly:
GROUP BY `group`.`name`, `group`.`id`
Sticking Point
I finally got stuck -- or, perhaps I should say, decided/realized that the next step was too big of a time-investment -- when trying to figure out where and why this error was happening (reformatted slightly for readability):
2017-04-08 19:33:18@wrk58e93afe0cd759.83335256 [NORMAL]:dba.php:289:q DB Error (Connected) 1050: Table 'temp-addon' already exists 2017-04-08 19:33:18@wrk58e93afe0cd759.83335256 [NORMAL]:dba.php:328:q dba: CREATE TABLE `temp-addon` LIKE `addon`; returned false. Table 'temp-addon' already exists 2017-04-08 19:33:18@wrk58e93afe0cd759.83335256 []:dbstructure.php:25:update_fail Cannot notify administrators about update_id=1216, error_message=Errors encountered performing database changes. ALTER TABLE `temp-addon` MODIFY `name` varchar(190) NOT NULL DEFAULT '', MODIFY `version` varchar(255) NOT NULL DEFAULT '', ADD UNIQUE INDEX `name` (`name`);<br />
I found where the error was being thrown, but would have to do some significant backtracing just to figure out what was executing the problematic SQL, and/or what was generating it... and, most importantly, why.
