From: atif-shaikh Date: Thu, 9 Oct 2014 10:31:01 +0000 (+0530) Subject: CRM-15343 - 4.5.0 corrupts soft references to case-types X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=0a11e22cc3cb49e2d696cfa7185800c9fd3f160f;p=civicrm-core.git CRM-15343 - 4.5.0 corrupts soft references to case-types https://issues.civicrm.org/jira/browse/CRM-15343 --- diff --git a/CRM/Case/xml/configuration.sample/case_sample.mysql.tpl b/CRM/Case/xml/configuration.sample/case_sample.mysql.tpl index 75c1dd5328..ed19acdaf0 100644 --- a/CRM/Case/xml/configuration.sample/case_sample.mysql.tpl +++ b/CRM/Case/xml/configuration.sample/case_sample.mysql.tpl @@ -18,6 +18,13 @@ INSERT IGNORE INTO `civicrm_case_type` ( {localize field='title'}`title`{/local ({localize}'{ts escape="sql"}Housing Support{/ts}'{/localize}, 'housing_support', {localize}'{ts escape="sql"}Help homeless individuals obtain temporary and long-term housing{/ts}'{/localize}, @max_wt + 1, 0, 1), ({localize}'{ts escape="sql"}Adult Day Care Referral{/ts}'{/localize}, 'adult_day_care_referral', {localize}'{ts escape="sql"}Arranging adult day care for senior individuals{/ts}'{/localize}, @max_wt + 2, 0, 1); +-- CRM-15343 set the auto increment civicrm_case_type.id start point to max id to avoid conflict in future insertion +SELECT @max_case_type_id := max(id) from civicrm_case_type; +SET @query = CONCAT("ALTER TABLE civicrm_case_type AUTO_INCREMENT = ", IFNULL(@max_case_type_id,1)); +PREPARE alter_case_type_auto_inc FROM @query; +EXECUTE alter_case_type_auto_inc; +DEALLOCATE PREPARE alter_case_type_auto_inc; + -- /******************************************************* -- * -- * Case Status - Set names for Open and Closed diff --git a/CRM/Upgrade/Incremental/sql/4.5.alpha1.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.5.alpha1.mysql.tpl index 04777af7eb..25da57f256 100644 --- a/CRM/Upgrade/Incremental/sql/4.5.alpha1.mysql.tpl +++ b/CRM/Upgrade/Incremental/sql/4.5.alpha1.mysql.tpl @@ -348,7 +348,7 @@ ALTER TABLE civicrm_case -- CRM-15343 set the auto increment civicrm_case_type.id start point to max id to avoid conflict in future insertion SELECT @max_case_type_id := max(id) from civicrm_case_type; -SET @query = CONCAT("ALTER TABLE civicrm_case_type AUTO_INCREMENT = ", @max_case_type_id); +SET @query = CONCAT("ALTER TABLE civicrm_case_type AUTO_INCREMENT = ", IFNULL(@max_case_type_id,1)); PREPARE alter_case_type_auto_inc FROM @query; EXECUTE alter_case_type_auto_inc; DEALLOCATE PREPARE alter_case_type_auto_inc;