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

civicrm_contribution_product schema inconsistent in fresh installs vs upgrades

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.3.5
    • Fix Version/s: 4.3.6
    • Component/s: CiviContribute
    • Labels:
      None

      Description

      This probably affects other 4.3.x releases; I didn't really dig.

      A fresh install reads in civicrm.mysql, which does:

      CREATE TABLE `civicrm_contribution_product` (
      – some stuff
      CONSTRAINT `FK_civicrm_contribution_product_financial_type_id` FOREIGN KEY (`financial_type_id`) REFERENCES `civicrm_financial_type` (`id`) ON DELETE SET NULL
      )

      An upgrade uses CRM/Upgrade/Incremental/sql/4.3.alpha1.mysql.tpl, which does:

      ALTER TABLE `civicrm_contribution_product`
      – some stuff
      ADD CONSTRAINT `FK_civicrm_contribution_product_financial_type_id` FOREIGN KEY (`financial_type_id`) REFERENCES `civicrm_financial_type` (`id`);

      In other words, upgrades are missing the ON DELETE clause.

      I'd be happy to patch this with a little guidance. Is the proper approach to drop and correctly add the constraint in 4.3.6.mysql.tpl?

        Attachments

          Activity

            People

            • Assignee:
              dgg David Greenberg
              Reporter:
              pittstains Frank J. Gómez
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours
                4h