public function upgrade_4_7_10($rev) {
$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');
}
/*
return TRUE;
}
+ /**
+ * CRM-19100 - Alter Index and Type for Image URL
+ * @return bool
+ */
+ public static function alterIndexAndTypeForImageURL() {
+ $dao = CRM_Core_DAO::executeQuery("SHOW INDEX FROM civicrm_contact WHERE KEY_NAME = 'index_image_url'");
+ if ($dao->N) {
+ CRM_Core_DAO::executeQuery("ALTER TABLE `civicrm_contact` DROP INDEX `index_image_url`");
+ }
+ CRM_Core_DAO::executeQuery("ALTER TABLE `civicrm_contact` CHANGE `image_URL` `image_URL` TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT 'optional URL for preferred image (photo, logo, etc.) to display for this contact.'");
+ CRM_Core_DAO::executeQuery("CREATE INDEX `index_image_url` ON `civicrm_contact` ( image_URL(128) )");
+
+ return TRUE;
+ }
+
}
{* file to handle db changes in 4.7.8 during upgrade *}
-#CRM-17967 - Allow conact image file name length during upload up to 255 characters long
-ALTER TABLE `civicrm_contact` CHANGE `image_URL` `image_URL` VARCHAR(512) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT 'optional URL for preferred image (photo, logo, etc.) to display for this contact.';
-
-- CRM-18516 Convert the date fields relating to group caching and acl caching timestamp
ALTER TABLE civicrm_group CHANGE cache_date cache_date timestamp NULL DEFAULT NULL , CHANGE refresh_date refresh_date timestamp NULL DEFAULT NULL;
ALTER TABLE civicrm_acl_cache CHANGE modified_date modified_date timestamp NULL DEFAULT NULL;