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

civicrm_contribution_recur 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

      A fresh install creates an index on field payment_instrument_id called UI_contrib_payment_instrument_id. An update (rather than a fresh install) results in an index on the same field, but the index is called UI_contribution_recur_payment_instrument_id. (This index is added in CRM/Upgrade/Incremental/sql/4.1.alpha1.mysql.tpl.)

      I can imagine a future upgrade script might throw an error trying to drop a nonexistent key as a result of this discrepancy.

      Also, my upgraded database has the following constraints, which are not present in my clean install:

      CONSTRAINT `FK_civicrm_contribution_recur_campaign_id` FOREIGN KEY (`campaign_id`) REFERENCES `civicrm_campaign` (`id`) ON DELETE SET NULL,
      CONSTRAINT `FK_civicrm_contribution_recur_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE,
      CONSTRAINT `FK_civicrm_contribution_recur_financial_type_id` FOREIGN KEY (`financial_type_id`) REFERENCES `civicrm_financial_type` (`id`),
      CONSTRAINT `FK_civicrm_contribution_recur_payment_processor_id` FOREIGN KEY (`payment_processor_id`) REFERENCES `civicrm_payment_processor` (`id`) ON DELETE SET NULL

      I suspect the upgrade gets this right and it's the clean install which needs correcting. Can anyone confirm or deny that?

        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 - 5 hours
                5h