Merge pull request #4054 from eileenmcnaughton/CRM-15237
[civicrm-core.git] / CRM / Upgrade / Incremental / sql / 2.1.2.mysql
1 -- /****************************************************************************
2 -- *
3 -- * MySQL Script for civicrm database/tables - upgradation from 2.1.1 -> 2.1.2
4 -- *
5 -- *****************************************************************************/
6 -- fix constraint
7 ALTER TABLE `civicrm_group_nesting`
8 DROP FOREIGN KEY `FK_civicrm_group_nesting_child_group_id`;
9 ALTER TABLE `civicrm_group_nesting`
10 ADD CONSTRAINT `FK_civicrm_group_nesting_child_group_id` FOREIGN KEY (`child_group_id`) REFERENCES `civicrm_group` (`id`) ON DELETE CASCADE;
11
12 -- CRM-3749
13 UPDATE civicrm_uf_field SET field_type = 'Contact'
14 WHERE field_name IN ('address_name','city','contact_sub_type','contact_type','country','custom_greeting','display_name','do_not_email','do_not_mail','do_not_phone','do_not_trade','email','external_identifier','geo_code_1','geo_code_2','group','im','image_URL','id','nick_name','is_opt_out','on_hold','openid','phone','postal_code','postal_code_suffix','preferred_communication_method','preferred_mail_format','sort_name','contact_source','state_province','street_address','supplemental_address_1','supplemental_address_2','tag','user_unique_id','is_bulkmail','world_region');
15
16 -- civicrm_note constraint fix
17 ALTER TABLE civicrm_note
18 DROP FOREIGN KEY `FK_civicrm_note_contact_id`;
19 ALTER TABLE `civicrm_note`
20 ADD CONSTRAINT `FK_civicrm_note_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE SET NULL;