From dc73c80de919aebca54e2ec6e4e9bcf502e7298a Mon Sep 17 00:00:00 2001 From: kurund Date: Sat, 8 Feb 2014 11:49:59 -0800 Subject: [PATCH] CRM-14181 fixes - migrate enums to varchar in schema for all tables http://issues.civicrm.org/jira/browse/CRM-14181 --- CRM/Upgrade/Incremental/sql/4.5.alpha1.mysql.tpl | 11 +++++++++++ xml/schema/Contact/Contact.xml | 4 ++-- xml/schema/Contact/Group.xml | 4 ++-- xml/schema/Contact/GroupContact.xml | 4 ++-- xml/schema/Contact/RelationshipType.xml | 8 ++++---- xml/schema/Contact/SubscriptionHistory.xml | 8 ++++---- xml/schema/Contribute/ContributionRecur.xml | 4 ++-- xml/schema/Contribute/Product.xml | 12 ++++++------ 8 files changed, 33 insertions(+), 22 deletions(-) diff --git a/CRM/Upgrade/Incremental/sql/4.5.alpha1.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.5.alpha1.mysql.tpl index 0d93b45d09..da27942385 100644 --- a/CRM/Upgrade/Incremental/sql/4.5.alpha1.mysql.tpl +++ b/CRM/Upgrade/Incremental/sql/4.5.alpha1.mysql.tpl @@ -227,5 +227,16 @@ ALTER TABLE `civicrm_custom_field` CHANGE `html_type` `html_type` VARCHAR( 32 ALTER TABLE `civicrm_action_schedule` CHANGE `start_action_unit` `start_action_unit` VARCHAR( 8 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT 'Time units for reminder.'; ALTER TABLE `civicrm_action_schedule` CHANGE `repetition_frequency_unit` `repetition_frequency_unit` VARCHAR( 8 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT 'Time units for repetition of reminder.'; ALTER TABLE `civicrm_action_schedule` CHANGE `end_frequency_unit` `end_frequency_unit` VARCHAR( 8 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT 'Time units till repetition of reminder.'; +ALTER TABLE `civicrm_product` CHANGE `period_type` `period_type` VARCHAR( 8 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT 'rolling' COMMENT 'Rolling means we set start/end based on current day, fixed means we set start/end for current year or month(e.g. 1 year + fixed -> we would set start/end for 1/1/06 thru 12/31/06 for any premium chosen in 2006) '; +ALTER TABLE `civicrm_product` CHANGE `duration_unit` `duration_unit` VARCHAR( 8 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT 'year'; +ALTER TABLE `civicrm_product` CHANGE `frequency_unit` `frequency_unit` VARCHAR( 8 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT 'month' COMMENT 'Frequency unit and interval allow option to store actual delivery frequency for a subscription or service.'; +ALTER TABLE `civicrm_contribution_recur` CHANGE `frequency_unit` `frequency_unit` VARCHAR( 8 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT 'month' COMMENT 'Time units for recurrence of payment.'; +ALTER TABLE `civicrm_subscription_history` CHANGE `method` `method` VARCHAR( 8 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT 'How the (un)subscription was triggered'; +ALTER TABLE `civicrm_subscription_history` CHANGE `status` `status` VARCHAR( 8 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT 'The state of the contact within the group'; +ALTER TABLE `civicrm_relationship_type` CHANGE `contact_type_a` `contact_type_a` VARCHAR( 12 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT 'If defined, contact_a in a relationship of this type must be a specific contact_type.'; +ALTER TABLE `civicrm_relationship_type` CHANGE `contact_type_b` `contact_type_b` VARCHAR( 12 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT 'If defined, contact_b in a relationship of this type must be a specific contact_type.'; +ALTER TABLE `civicrm_group_contact` CHANGE `status` `status` VARCHAR( 8 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT 'status of contact relative to membership in group'; +ALTER TABLE `civicrm_group` CHANGE `visibility` `visibility` VARCHAR( 24 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT 'User and User Admin Only' COMMENT 'In what context(s) is this field visible.'; +ALTER TABLE `civicrm_contact` CHANGE `preferred_mail_format` `preferred_mail_format` VARCHAR( 8 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT 'Both' COMMENT 'What is the preferred mode of sending an email.'; diff --git a/xml/schema/Contact/Contact.xml b/xml/schema/Contact/Contact.xml index 16d84cb40f..de9c87503b 100644 --- a/xml/schema/Contact/Contact.xml +++ b/xml/schema/Contact/Contact.xml @@ -315,8 +315,8 @@ preferred_mail_format - enum - Text, HTML, Both + varchar + 8 "Both" true /^p(ref\w*\s)?m(ail\s)?f(orm\w*)$/i diff --git a/xml/schema/Contact/Group.xml b/xml/schema/Contact/Group.xml index fe3a4bb54d..1934d644aa 100644 --- a/xml/schema/Contact/Group.xml +++ b/xml/schema/Contact/Group.xml @@ -79,9 +79,9 @@ visibility - enum + varchar + 24 Group Visibility Setting - User and User Admin Only,Public Pages 'User and User Admin Only' In what context(s) is this field visible. 1.2 diff --git a/xml/schema/Contact/GroupContact.xml b/xml/schema/Contact/GroupContact.xml index d1a51b6d46..76d7e60798 100644 --- a/xml/schema/Contact/GroupContact.xml +++ b/xml/schema/Contact/GroupContact.xml @@ -59,9 +59,9 @@ status - enum + varchar + 8 Group Contact Status - Added, Removed, Pending status of contact relative to membership in group 1.1 diff --git a/xml/schema/Contact/RelationshipType.xml b/xml/schema/Contact/RelationshipType.xml index 92f3df9264..c805b517ce 100644 --- a/xml/schema/Contact/RelationshipType.xml +++ b/xml/schema/Contact/RelationshipType.xml @@ -61,9 +61,9 @@ contact_type_a - enum Contact Type for Contact A - Individual, Organization, Household + varchar + 12 If defined, contact_a in a relationship of this type must be a specific contact_type. 1.1 @@ -72,9 +72,9 @@ contact_type_b - enum Contact Type for Contact B - Individual, Organization, Household + varchar + 12 If defined, contact_b in a relationship of this type must be a specific contact_type. 1.1 diff --git a/xml/schema/Contact/SubscriptionHistory.xml b/xml/schema/Contact/SubscriptionHistory.xml index cf4cea608c..aff77bd854 100644 --- a/xml/schema/Contact/SubscriptionHistory.xml +++ b/xml/schema/Contact/SubscriptionHistory.xml @@ -62,8 +62,8 @@ method - enum - Admin, Email, Web, API + varchar + 8 How the (un)subscription was triggered 1.1 @@ -72,8 +72,8 @@ status - enum - Added, Removed, Pending, Deleted + varchar + 8 The state of the contact within the group 1.1 diff --git a/xml/schema/Contribute/ContributionRecur.xml b/xml/schema/Contribute/ContributionRecur.xml index 3fa592604a..b08c5fa151 100644 --- a/xml/schema/Contribute/ContributionRecur.xml +++ b/xml/schema/Contribute/ContributionRecur.xml @@ -61,8 +61,8 @@ frequency_unit Frequency Unit - enum - day,week,month,year + varchar + 8 'month' Time units for recurrence of payment. 1.6 diff --git a/xml/schema/Contribute/Product.xml b/xml/schema/Contribute/Product.xml index afa097a352..4bf3d1f095 100644 --- a/xml/schema/Contribute/Product.xml +++ b/xml/schema/Contribute/Product.xml @@ -135,8 +135,8 @@ period_type Period Type - enum - rolling,fixed + varchar + 8 'rolling' Rolling means we set start/end based on current day, fixed means we set start/end for current year or month (e.g. 1 year + fixed -> we would set start/end for 1/1/06 thru 12/31/06 for any premium chosen in 2006) @@ -156,8 +156,8 @@ duration_unit Duration Unit - enum - day,month,week,year + varchar + 8 'year' 1.4 @@ -174,8 +174,8 @@ frequency_unit Frequency Unit - enum - day,month,week,year + varchar + 8 'month' Frequency unit and interval allow option to store actual delivery frequency for a subscription or service. 1.4 -- 2.25.1