FEU Upgrade: foreign key constraint fails

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
User avatar
webform
Power Poster
Power Poster
Posts: 524
Joined: Sat Nov 25, 2006 3:39 pm

FEU Upgrade: foreign key constraint fails

Post by webform »

I've got the "fun" task to upgrade a very old CMSMS site from v. 1.7.1. to current version 2.2.3.1.

Mostly it's gone ok but i can't upgrade "Frontend User" (FEU) past v. 1.29. without this error:

Code: Select all

ALTER TABLE cms_module_feusers_properties ADD FOREIGN KEY (title) REFERENCES cms_module_feusers_propdefn (name) Cannot add or update a child row: a foreign key constraint fails (`mb2017`.`#sql-56d_4e`, CONSTRAINT `#sql-56d_4e_ibfk_2` FOREIGN KEY (`title`) REFERENCES `cms_module_feusers_propdefn` (`name`))
Is there a way to fix this problem so i can upgrade FEU to latest version?
User avatar
webform
Power Poster
Power Poster
Posts: 524
Joined: Sat Nov 25, 2006 3:39 pm

Re: FEU Upgrade: foreign key constraint fails

Post by webform »

Anyone has any suggestions how i solve this problem, so i can upgrade FEU to latest version?

I've tried upgrade to nearly every version after 1.29 but i seem stuck on "foreign key constraint" error on every attempt.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: FEU Upgrade: foreign key constraint fails

Post by calguy1000 »

The error means you have some corrupt data in your properties table.

The upgrade is attempting to create a foreign key relationship that maintains the relationship between property values and property definitions, and there there are one or more values in the properties table that do not match properties that are defined elsewhere.

so, before the upgrade can proceed you will need to find all values in the _properties table who's title is NOT IN the propdefn table, and then remove them.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
User avatar
webform
Power Poster
Power Poster
Posts: 524
Joined: Sat Nov 25, 2006 3:39 pm

Re: FEU Upgrade: foreign key constraint fails

Post by webform »

Thanks!

I will run through my tables and see if i can find the offending properties.
User avatar
webform
Power Poster
Power Poster
Posts: 524
Joined: Sat Nov 25, 2006 3:39 pm

Re: FEU Upgrade: foreign key constraint fails

Post by webform »

I succeeded finding the corrupt data in the properties table ;D

Out of approx. 9000 records, 4 had a value not present in the propdefn table.

I deleted the 4 records and now i could upgrade FEU to latest version.

Thanks Calguy for pointing me in the right direction.
Locked

Return to “Modules/Add-Ons”