I'm trying to upgrade our 0.3.1 installation to 0.4.2.
When I execute the following SQL upgrade lines, I get the errors that follow them:
mysql> ALTER TABLE contacts
ADD CONSTRAINT user_id_fk_contacts
FOREIGN KEY (user_id
)
-> REFERENCES users
(user_id
) ON DELETE CASCADE ON UPDATE CASCADE;
ERROR 1452 (23000): Cannot add or update a child row: a foreign key
constraint fails (pis_roundcube/#sql-36e8_638
, CONSTRAINT
user_id_fk_contacts
FOREIGN KEY (user_id
) REFERENCES users
(user_id
) ON DELETE CASCADE ON UPDATE CASCADE)
mysql> ALTER TABLE identities
ADD CONSTRAINT user_id_fk_identities
FOREIGN KEY (user_id
)
-> REFERENCES users
(user_id
) ON DELETE CASCADE ON UPDATE CASCADE;
ERROR 1452 (23000): Cannot add or update a child row: a foreign key
constraint fails (pis_roundcube/#sql-36e8_638
, CONSTRAINT
user_id_fk_identities
FOREIGN KEY (user_id
) REFERENCES users
(user_id
) ON DELETE CASCADE ON UPDATE CASCADE)
The first 2 ALTER TABLE commands work OK, and I've verified all tables have been changed to InnoDB. Any ideas on how to get this to work?
Alternately, is there a good way to import data from an existing older roundcube MySQL database into a fresh, up-to-date one?
Thanks!
- John