CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Upgrade Error from 2.2.8 to 3.01 - DB Error: constraint violation
Pages: [1]

Author Topic: Upgrade Error from 2.2.8 to 3.01 - DB Error: constraint violation  (Read 870 times)

toddchris

  • Guest
Upgrade Error from 2.2.8 to 3.01 - DB Error: constraint violation
October 28, 2009, 08:12:11 am
I couldn't see this error listed so far.  Has anyone had this issue? 

I don't know what I'm doing wrong.  I have yet to not have a problem on an upgrade.  When I upgraded to 2.2 I had to dump my data and reload it to a DB structure based on the install script.  Do I need to do that again?  If so, I can't seem to find the link to how to do that exactly.

Any help would be greatly appreciated.

tc

Code: [Select]
Sorry. A non-recoverable error has occurred.





--------------------------------------------------------------------------------

DB Error: constraint violation

Database Error Code: Cannot add or update a child row: a foreign key constraint fails (`mynladat_civicrm/#sql-479e_234a`, CONSTRAINT `FK_civicrm_uf_match_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE), 1452

Return to home page.

Error Details:


Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -3
    [message] => DB Error: constraint violation
    [mode] => 16
    [debug_info] => ALTER TABLE `civicrm_uf_match`
        ADD CONSTRAINT `FK_civicrm_uf_match_domain_id` FOREIGN KEY (`domain_id`) REFERENCES `civicrm_domain` (`id`),
        ADD CONSTRAINT `FK_civicrm_uf_match_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE,
        ADD UNIQUE `UI_uf_name_domain_id` (`uf_name`,`domain_id`),
        ADD UNIQUE `UI_contact_domain_id` (`contact_id`,`domain_id`) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`mynladat_civicrm/#sql-479e_234a`, CONSTRAINT `FK_civicrm_uf_match_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]
    [type] => DB_Error
    [user_info] => ALTER TABLE `civicrm_uf_match`
        ADD CONSTRAINT `FK_civicrm_uf_match_domain_id` FOREIGN KEY (`domain_id`) REFERENCES `civicrm_domain` (`id`),
        ADD CONSTRAINT `FK_civicrm_uf_match_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE,
        ADD UNIQUE `UI_uf_name_domain_id` (`uf_name`,`domain_id`),
        ADD UNIQUE `UI_contact_domain_id` (`contact_id`,`domain_id`) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`mynladat_civicrm/#sql-479e_234a`, CONSTRAINT `FK_civicrm_uf_match_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]
    [to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="" info="ALTER TABLE `civicrm_uf_match`
        ADD CONSTRAINT `FK_civicrm_uf_match_domain_id` FOREIGN KEY (`domain_id`) REFERENCES `civicrm_domain` (`id`),
        ADD CONSTRAINT `FK_civicrm_uf_match_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE,
        ADD UNIQUE `UI_uf_name_domain_id` (`uf_name`,`domain_id`),
        ADD UNIQUE `UI_contact_domain_id` (`contact_id`,`domain_id`) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`mynladat_civicrm/#sql-479e_234a`, CONSTRAINT `FK_civicrm_uf_match_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]"]
)
[/code]

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Re: Upgrade Error from 2.2.8 to 3.01 - DB Error: constraint violation
October 28, 2009, 10:32:35 am
the link is on the bottom of the upgrade page...kinda hidden. here's the link to the forum post on how to do it, but in this case you would do it for 2.2 as opposed to 2.0

http://forum.civicrm.org/index.php/topic,4259.msg21599.html#msg21599

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Upgrade Error from 2.2.8 to 3.01 - DB Error: constraint violation

This forum was archived on 2017-11-26.