Merge pull request #4054 from eileenmcnaughton/CRM-15237
[civicrm-core.git] / CRM / Upgrade / Incremental / sql / 4.1.2.mysql.tpl
1 -- CRM-9795 (fix duplicate option values)
2
3 SELECT @option_group_id_act := max(id) from civicrm_option_group where name = 'activity_type';
4 SELECT @maxValue := MAX(ROUND(value)) FROM civicrm_option_value WHERE option_group_id = @option_group_id_act;
5 SELECT @clientCaseValue := value FROM civicrm_option_value WHERE name = 'Add Client To Case' AND option_group_id = @option_group_id_act;
6
7 UPDATE civicrm_option_value SET value = @maxValue + 1 WHERE name = 'Add Client To Case' AND option_group_id = @option_group_id_act;
8
9 UPDATE civicrm_activity
10 INNER JOIN civicrm_case_activity ON civicrm_activity.id = civicrm_case_activity.activity_id
11 SET civicrm_activity.activity_type_id = @maxValue + 1
12 WHERE civicrm_activity.activity_type_id = @clientCaseValue;
13
14 -- CRM-9868 Force disable jobs that should only be run manually
15 UPDATE civicrm_job
16 SET is_active = 0
17 WHERE api_action IN ('process_membership_reminder_date','update_greeting');
18
19 UPDATE civicrm_job
20 SET 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}'
21 WHERE api_action = 'process_membership_reminder_date';
22