Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-414

Constraint error when creating database

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 1.1
    • Fix Version/s: 1.1
    • Component/s: None
    • Labels:
      None

      Description

      1. Create fresh database
      2. mysql -u user -p < sql/civicrm_40.mysql
      3. mysql -u user -p < sql/civicrm_data.mysql
      ERROR 1216 at line 49: Cannot add or update a child row: a foreign key constraint fails

      Caused by this line:
      INSERT INTO civicrm_county (name, state_province_id) VALUES ('Alameda', 1004);

      Table civicrm_state_province is empty, therefore there's no record with 1004 in it.

      This was performed on Mysql 4.0 Populating civicrm_country and civicrm_state_province before inserting civicrm_data.mysql did the trick.

        Attachments

          Activity

            People

            • Assignee:
              shot Piotr Szotkowski
              Reporter:
              mover Michał Mach
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: