$this->addTask(ts('Upgrade DB to %1: SQL', array(1 => $rev)), 'runSql', $rev);
$this->addTask(ts('Upgrade Add Help Pre and Post Fields to price value table'), 'addHelpPreAndHelpPostFieldsPriceFieldValue');
$this->addTask(ts('Alter index and type for image URL'), 'alterIndexAndTypeForImageURL');
+ $this->addTask(ts('Add Data Type column to civicrm_option_group'), 'addDataTypeColumnToOptionGroupTable');
}
/**
return TRUE;
}
+ /**
+ * CRM-18651 Add DataType column to Option Group Table
+ * @return bool
+ */
+ public static function addDataTypeColumnToOptionGroupTable() {
+ if (!CRM_Core_BAO_SchemaHandler::checkIfFieldExists('civicrm_option_group', 'data_type') {
+ CRM_Core_DAO::executeQuery("ALTER TABLE `civicrm_option_group` ADD COLUMN `data_type` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL comment 'Data Type of Option Group.'");
+ }
+ CRM_Core_DAO::executeQuery("UPDATE `civicrm_option_group` SET `data_type` = 'Integer'
+ WHERE name IN ('activity_type', 'gender', 'payment_instrument', 'participant_role', 'event_type')");
+ return TRUE;
+ }
+
}
`civicrm_option_value` (`option_group_id`, {localize field='label'}label{/localize}, `value`, `name`, `grouping`, `filter`, `is_default`, `weight`, `is_optgroup`, `is_reserved`, `is_active`)
VALUES
(@option_group_id_ext, {localize}'{ts escape="sql"}odt{/ts}'{/localize}, @option_group_id_ext_val+1, 'odt', NULL, 0, 0, @option_group_id_ext_wt+1, 0, 1, 1);
-
---CRM-18651 Add in Data Type colum to option group table and set for some option groups
-ALTER TABLE civicrm_option_group
-ADD `data_type` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Data Type of Option Group.';
-UPDATE civicrm_option_group SET `data_type` = 'Integer'
-WHERE name in ('activity_type', 'gender', 'payment_instrument', 'participant_role', 'event_type',
- 'activity_status',);