Skip to content
Snippets Groups Projects
Commit 9e1a3f4f authored by Pradeep Nayak's avatar Pradeep Nayak
Browse files

-- CRM-13446, fixed upgrade if current version is less then 4.3

----------------------------------------
* CRM-13446: Add ON DELETE Options for constraints fails
  http://issues.civicrm.org/jira/browse/CRM-13446
parent 1043c809
Branches
Tags
No related merge requests found
......@@ -78,9 +78,16 @@ class CRM_Upgrade_Incremental_php_FourThree {
$constraintArray = array(
'civicrm_contact' => 'contact_id',
'civicrm_campaign' => 'campaign_id',
'civicrm_payment_processor' => 'payment_processor_id',
'civicrm_financial_type' => 'financial_type_id'
);
if (version_compare('4.1alpha1', $currentVer) <= 0) {
$constraintArray['civicrm_campaign'] = 'campaign_id';
}
if (version_compare('4.3alpha1', $currentVer) <= 0) {
$constraintArray['civicrm_financial_type'] = 'financial_type_id';
}
foreach ($constraintArray as $key => $value) {
$query = "SELECT contri_recur.id FROM civicrm_contribution_recur contri_recur LEFT JOIN {$key} ON contri_recur.{$value} = {$key}.id
WHERE {$key}.id IS NULL";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment