Author Topic: Upgrading 1.4.12 to 1.5.1 DB upgrade for mysql fails  (Read 2337 times)

Offline cdieni

  • Newbie
  • *
  • Posts: 2
Upgrading 1.4.12 to 1.5.1 DB upgrade for mysql fails
« on: December 03, 2021, 06:44:10 PM »
Never had issues upgrading roundcube, until now:

Updating database schema (2020020101)... [FAILED]
ERROR: Error in DDL upgrade 2020020101: [1091] Can't DROP FOREIGN KEY `user_id_fk_cache`; check that it exists

I am not impressed...

Offline cdieni

  • Newbie
  • *
  • Posts: 2
Re: Upgrading 1.4.12 to 1.5.1 DB upgrade for mysql fails
« Reply #1 on: December 03, 2021, 06:49:49 PM »
The upgrade file 2020020101.sql has has these commands:

ALTER TABLE `cache` DROP FOREIGN KEY `user_id_fk_cache`;
ALTER TABLE `cache_index` DROP FOREIGN KEY `user_id_fk_cache_index`;
ALTER TABLE `cache_thread` DROP FOREIGN KEY `user_id_fk_cache_thread`;
ALTER TABLE `cache_messages` DROP FOREIGN KEY `user_id_fk_cache_messages`
ALTER TABLE `contactgroups` DROP FOREIGN KEY `user_id_fk_contactgroups`;
ALTER TABLE `contacts` DROP FOREIGN KEY `user_id_fk_contacts`;
ALTER TABLE `dictionary` DROP FOREIGN KEY `user_id_fk_dictionary`;
ALTER TABLE `filestore` DROP FOREIGN KEY `user_id_fk_filestore`;
ALTER TABLE `identities` DROP FOREIGN KEY `user_id_fk_identities`;
ALTER TABLE `searches` DROP FOREIGN KEY `user_id_fk_searches`;

It cannot drop the foreign key because it is not there on 1.4.12.

This script is wrong or relates maybe to 1.5.0 which is no longer online to download...

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,845
Re: Upgrading 1.4.12 to 1.5.1 DB upgrade for mysql fails
« Reply #2 on: December 04, 2021, 03:06:27 AM »
The user_id_fk_cache key has been part of the Roundcube database for more then 10 years see https://github.com/roundcube/roundcubemail/commit/94fe9ca1a87b20ddeee55024986e95ca72097af6 may be you had some problem in the past with a db update or something.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and moreā€¦