Merge pull request #4054 from eileenmcnaughton/CRM-15237
[civicrm-core.git] / CRM / Upgrade / Incremental / sql / 4.1.2.mysql.tpl
CommitLineData
6a488035
TO
1-- CRM-9795 (fix duplicate option values)
2
3SELECT @option_group_id_act := max(id) from civicrm_option_group where name = 'activity_type';
4SELECT @maxValue := MAX(ROUND(value)) FROM civicrm_option_value WHERE option_group_id = @option_group_id_act;
5SELECT @clientCaseValue := value FROM civicrm_option_value WHERE name = 'Add Client To Case' AND option_group_id = @option_group_id_act;
6
7UPDATE civicrm_option_value SET value = @maxValue + 1 WHERE name = 'Add Client To Case' AND option_group_id = @option_group_id_act;
8
10824d34 9UPDATE civicrm_activity
6a488035
TO
10INNER JOIN civicrm_case_activity ON civicrm_activity.id = civicrm_case_activity.activity_id
11SET civicrm_activity.activity_type_id = @maxValue + 1
12WHERE civicrm_activity.activity_type_id = @clientCaseValue;
13
14-- CRM-9868 Force disable jobs that should only be run manually
15UPDATE civicrm_job
16SET is_active = 0
17WHERE api_action IN ('process_membership_reminder_date','update_greeting');
18
19UPDATE civicrm_job
20SET description = '{ts escape="sql"}Sets membership renewal reminder dates for current membership records where reminder date is null. This job should never be run automatically as it will cause members to get renewal reminders repeatedly.{/ts}'
21WHERE api_action = 'process_membership_reminder_date';
22