CRM-14197 alter index to include contribution id
authorEileen McNaughton <eileen@fuzion.co.nz>
Thu, 15 May 2014 23:59:19 +0000 (11:59 +1200)
committerEileen McNaughton <eileen@fuzion.co.nz>
Mon, 19 May 2014 09:46:40 +0000 (21:46 +1200)
CRM/Upgrade/Incremental/sql/4.5.alpha1.mysql.tpl

index 6be98cebaa6f34475532e1a15e7e3158e9d744fd..f853f92816eb03a38d0278704cc6245561f94b77 100644 (file)
@@ -528,6 +528,10 @@ ALTER TABLE civicrm_line_item ADD contribution_id INT(10) COMMENT 'Contribution
 ALTER TABLE civicrm_line_item
 ADD CONSTRAINT `FK_civicrm_contribution_id` FOREIGN KEY (`contribution_id`) REFERENCES civicrm_contribution (`id`) ON DELETE SET NULL;
 
+ALTER TABLE `civicrm_line_item`
+DROP INDEX `UI_line_item_value`,
+ADD UNIQUE INDEX `UI_line_item_value` (`entity_table`, `entity_id`, `contribution_id`, `price_field_value_id`, `price_field_id`);
+
 -- store contribution id for participant records
 UPDATE  civicrm_line_item li LEFT JOIN civicrm_participant_payment pp ON pp.participant_id = li.entity_id
 SET li.contribution_id = pp.contribution_id