2022-01-09 20:39:56
2022-01-09 18:57:45
2022-01-09 18:57:45
372007
dbupdate problem updating to 2021.09
I got the below problem. It creates a new temp-apcontact table by copying apcontact. Adds uri-id to temp-apcontact. Then copies the data from the old into the new grouping by the new field, which clearly can't exist, right? Any suggestions?
$ sudo php bin/console.php dbstructure update
DROP TABLE IF EXISTS `temp-apcontact`;
CREATE TABLE `temp-apcontact` LIKE `apcontact`;
ALTER TABLE `temp-apcontact` ADD `uri-id` int unsigned COMMENT 'Id of the item-uri table entry that contains the apcontact url', ADD `xmpp` varchar(255) COMMENT 'XMPP address', ADD `matrix` varchar(255) COMMENT 'Matrix address', ADD UNIQUE INDEX `uri-id` (`uri-id`), ADD FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE;
INSERT INTO `temp-apcontact` SELECT ANY_VALUE(`url`),ANY_VALUE(`uuid`),ANY_VALUE(`type`),ANY_VALUE(`following`),ANY_VALUE(`followers`),ANY_VALUE(`inbox`),ANY_VALUE(`outbox`),ANY_VALUE(`sharedinbox`),ANY_VALUE(`manually-approve`),ANY_VALUE(`nick`),ANY_VALUE(`name`),ANY_VALUE(`about`),ANY_VALUE(`photo`),ANY_VALUE(`addr`),ANY_VALUE(`alias`),ANY_VALUE(`pubkey`),ANY_VALUE(`baseurl`),ANY_VALUE(`updated`),ANY_VALUE(`generator`),ANY_VALUE(`following_count`),ANY_VALUE(`followers_count`),ANY_VALUE(`statuses_count`),ANY_VALUE(`subscribe`),ANY_VALUE(`gsid`),ANY_VALUE(`header`),ANY_VALUE(`discoverable`) FROM `apcontact` GROUP BY `uri-id`;
DROP TABLE `apcontact`;
RENAME TABLE `temp-apcontact` TO `apcontact`;
Error 1054 occurred during database update:
Unknown column 'uri-id' in 'group statement'
Errors encountered performing database changes: ALTER TABLE `temp-apcontact` ADD `uri-id` int unsigned COMMENT 'Id of the item-uri table entry that contains the apcontact url', ADD `xmpp` varchar(255) COMMENT 'XMPP address', ADD `matrix` varchar(255) COMMENT 'Matrix address', ADD UNIQUE INDEX `uri-id` (`uri-id`), ADD FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE; <br />
!Friendica Support
$ sudo php bin/console.php dbstructure update
DROP TABLE IF EXISTS `temp-apcontact`;
CREATE TABLE `temp-apcontact` LIKE `apcontact`;
ALTER TABLE `temp-apcontact` ADD `uri-id` int unsigned COMMENT 'Id of the item-uri table entry that contains the apcontact url', ADD `xmpp` varchar(255) COMMENT 'XMPP address', ADD `matrix` varchar(255) COMMENT 'Matrix address', ADD UNIQUE INDEX `uri-id` (`uri-id`), ADD FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE;
INSERT INTO `temp-apcontact` SELECT ANY_VALUE(`url`),ANY_VALUE(`uuid`),ANY_VALUE(`type`),ANY_VALUE(`following`),ANY_VALUE(`followers`),ANY_VALUE(`inbox`),ANY_VALUE(`outbox`),ANY_VALUE(`sharedinbox`),ANY_VALUE(`manually-approve`),ANY_VALUE(`nick`),ANY_VALUE(`name`),ANY_VALUE(`about`),ANY_VALUE(`photo`),ANY_VALUE(`addr`),ANY_VALUE(`alias`),ANY_VALUE(`pubkey`),ANY_VALUE(`baseurl`),ANY_VALUE(`updated`),ANY_VALUE(`generator`),ANY_VALUE(`following_count`),ANY_VALUE(`followers_count`),ANY_VALUE(`statuses_count`),ANY_VALUE(`subscribe`),ANY_VALUE(`gsid`),ANY_VALUE(`header`),ANY_VALUE(`discoverable`) FROM `apcontact` GROUP BY `uri-id`;
DROP TABLE `apcontact`;
RENAME TABLE `temp-apcontact` TO `apcontact`;
Error 1054 occurred during database update:
Unknown column 'uri-id' in 'group statement'
Errors encountered performing database changes: ALTER TABLE `temp-apcontact` ADD `uri-id` int unsigned COMMENT 'Id of the item-uri table entry that contains the apcontact url', ADD `xmpp` varchar(255) COMMENT 'XMPP address', ADD `matrix` varchar(255) COMMENT 'Matrix address', ADD UNIQUE INDEX `uri-id` (`uri-id`), ADD FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE; <br />
!Friendica Support
Friendica Support reshared this.
Matthew Exon
Unknown parent • •Matthew Exon
in reply to Matthew Exon • •