MISC-32 Added comment from xml/schema
[civicrm-core.git] / CRM / Upgrade / Incremental / sql / 4.5.alpha1.mysql.tpl
index 4ed8515fa65a8dae4915beb9e1babe19cbb52cc8..f1ddbf77340648509b1e2728e646050b0b78bb97 100644 (file)
@@ -83,6 +83,11 @@ INSERT INTO `civicrm_option_value` (`option_group_id`, {localize field='label'}`
 ALTER TABLE `civicrm_contribution_soft`
   ADD COLUMN `soft_credit_type_id`  int(10) unsigned COMMENT 'Soft Credit Type ID.Implicit FK to civicrm_option_value where option_group = soft_credit_type.';
 
+INSERT INTO civicrm_contribution_soft(contribution_id, contact_id, amount, currency, soft_credit_type_id)
+SELECT id, honor_contact_id, total_amount, currency, honor_type_id
+FROM civicrm_contribution
+WHERE honor_contact_id IS NOT NULL;
+
 SELECT @sct_pcp_id := value from civicrm_option_value where name = 'pcp' and option_group_id = @option_group_id_soft_credit_type;
 
 UPDATE `civicrm_contribution_soft`
@@ -134,8 +139,7 @@ VALUES
       (@uf_group_id_honoree_individual, 'last_name',  0, 1, 3, 'User and User Admin Only', 0, 1, NULL, {localize}'{ts escape="sql"}Last Name{/ts}'{/localize},         'Individual'),
       (@uf_group_id_honoree_individual, 'email',      0, 1, 4, 'User and User Admin Only', 0, 1, 1,    {localize}'{ts escape="sql"}Email Address{/ts}'{/localize},     'Individual');
 
-ALTER TABLE `civicrm_uf_join`
-  ADD COLUMN `module_data` longtext COMMENT 'Json serialized array of data used by the ufjoin.module';
+UPDATE civicrm_uf_join SET uf_group_id = @uf_group_id_honoree_individual WHERE module = 'soft_credit';
 
 {if $multilingual}
   {foreach from=$locales item=loc}
@@ -314,6 +318,7 @@ CREATE TABLE IF NOT EXISTS `civicrm_case_type` (
   `is_active` tinyint(4) DEFAULT NULL COMMENT 'Is this entry active?',
   `is_reserved` tinyint(4) DEFAULT NULL COMMENT 'Is this case type a predefined system type?',
   `weight` int(11) NOT NULL DEFAULT '1' COMMENT 'Ordering of the case types',
+  `xml_definition` blob    COMMENT 'xml definition of case type',
   PRIMARY KEY (`id`),
   UNIQUE KEY `case_type_name` (`name`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;
@@ -514,3 +519,12 @@ WHERE co.id IS NULL;
     WHERE v.name = 'Awaiting Information';
 {/if}
 
+-- CRM-14197 Add contribution_id to civicrm_line_item
+
+ALTER TABLE civicrm_line_item ADD contribution_id INT(10) COMMENT 'Formal (academic or similar) title in front of name. (Prof., Dr. etc.)' NULL AFTER entity_id;
+
+-- FK to civicrm_contribution
+
+ALTER TABLE civicrm_line_item
+ADD CONSTRAINT `FK_civicrm_contribution_id` FOREIGN KEY (`contribution_id`) REFERENCES civicrm_contribution (`id`) ON DELETE SET NULL;
+