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

Delete custom field: DB Error Code: Error on rename of... (errno: 152),

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 3.0
    • Fix Version/s: 3.0.2
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      Deleting a custom field of type 'contact reference' produces an error. Seems to be related to renaming the foreign key.

      Steps to recreate on the demo site:
      1. Create a custom field of type 'contact reference'
      2. Delete it

      Error output:
      unrecoverable error
      Sorry. A non-recoverable error has occurred.
      DB Error: a515ac9c2796ca0e23adbe92c68fc9fc
      Database Error Code: Error on rename of './civicrm_demo_drupal/civicrm_value_constituent_information_1' to './civicrm_demo_drupal/#sql2-11cd-1b58c7' (errno: 152), 1025

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

      [code] => a515ac9c2796ca0e23adbe92c68fc9fc
      [message] => DB Error: a515ac9c2796ca0e23adbe92c68fc9fc
      [mode] => 16
      [debug_info] => ALTER TABLE civicrm_value_constituent_information_1 DROP COLUMN `related_4`, DROP FOREIGN KEY FK_civicrm_value_constituent_information_1_related_4 [nativecode=1025 ** Error on rename of './civicrm_demo_drupal/civicrm_value_constituent_information_1' to './civicrm_demo_drupal/#sql2-11cd-1b58c7' (errno: 152)]
      [type] => DB_Error
      [user_info] => ALTER TABLE civicrm_value_constituent_information_1 DROP COLUMN `related_4`, DROP FOREIGN KEY FK_civicrm_value_constituent_information_1_related_4 [nativecode=1025 ** Error on rename of './civicrm_demo_drupal/civicrm_value_constituent_information_1' to './civicrm_demo_drupal/#sql2-11cd-1b58c7' (errno: 152)]
      [to_string] => [db_error: message="DB Error: a515ac9c2796ca0e23adbe92c68fc9fc" code=0 mode=callback callback=CRM_Core_Error::handle prefix="" info=" ALTER TABLE civicrm_value_constituent_information_1 DROP COLUMN `related_4`, DROP FOREIGN KEY FK_civicrm_value_constituent_information_1_related_4 [nativecode=1025 ** Error on rename of './civicrm_demo_drupal/civicrm_value_constituent_information_1' to './civicrm_demo_drupal/#sql2-11cd-1b58c7' (errno: 152)]"]
      )

        Attachments

          Activity

            People

            • Assignee:
              sunil Sunil Pawar
              Reporter:
              bwaindwain BwainDwain
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: