From: Coleman Watts Date: Tue, 11 Feb 2020 22:22:42 +0000 (-0500) Subject: Add columns for api_entity & api_params to civicrm_saved_search X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=0d7216d375bb6bc92da2afff22f48efb668d4b0e;p=civicrm-core.git Add columns for api_entity & api_params to civicrm_saved_search --- diff --git a/CRM/Contact/DAO/SavedSearch.php b/CRM/Contact/DAO/SavedSearch.php index 5933323c54..f607b006b0 100644 --- a/CRM/Contact/DAO/SavedSearch.php +++ b/CRM/Contact/DAO/SavedSearch.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Contact/SavedSearch.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:d2d8b39f5f8869d8c5295810f8f2ad78) + * (GenCodeChecksum:a60876bf99e330f6a463247686a92f31) */ /** @@ -56,6 +56,20 @@ class CRM_Contact_DAO_SavedSearch extends CRM_Core_DAO { */ public $search_custom_id; + /** + * Entity name for API based search + * + * @var string + */ + public $api_entity; + + /** + * Parameters for API based search + * + * @var text + */ + public $api_params; + /** * Class constructor. */ @@ -136,6 +150,31 @@ class CRM_Contact_DAO_SavedSearch extends CRM_Core_DAO { 'bao' => 'CRM_Contact_BAO_SavedSearch', 'localizable' => 0, ], + 'api_entity' => [ + 'name' => 'api_entity', + 'type' => CRM_Utils_Type::T_STRING, + 'title' => ts('Entity Name'), + 'description' => ts('Entity name for API based search'), + 'maxlength' => 255, + 'size' => CRM_Utils_Type::HUGE, + 'where' => 'civicrm_saved_search.api_entity', + 'table_name' => 'civicrm_saved_search', + 'entity' => 'SavedSearch', + 'bao' => 'CRM_Contact_BAO_SavedSearch', + 'localizable' => 0, + ], + 'api_params' => [ + 'name' => 'api_params', + 'type' => CRM_Utils_Type::T_TEXT, + 'title' => ts('API Parameters'), + 'description' => ts('Parameters for API based search'), + 'where' => 'civicrm_saved_search.api_params', + 'table_name' => 'civicrm_saved_search', + 'entity' => 'SavedSearch', + 'bao' => 'CRM_Contact_BAO_SavedSearch', + 'localizable' => 0, + 'serialize' => self::SERIALIZE_JSON, + ], ]; CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); } diff --git a/CRM/Upgrade/Incremental/php/FiveTwentyFour.php b/CRM/Upgrade/Incremental/php/FiveTwentyFour.php index cee60608de..1b90c51619 100644 --- a/CRM/Upgrade/Incremental/php/FiveTwentyFour.php +++ b/CRM/Upgrade/Incremental/php/FiveTwentyFour.php @@ -46,12 +46,6 @@ class CRM_Upgrade_Incremental_php_FiveTwentyFour extends CRM_Upgrade_Incremental // } } - /* - * Important! All upgrade functions MUST add a 'runSql' task. - * Uncomment and use the following template for a new upgrade version - * (change the x in the function name): - */ - /** * Upgrade function. * @@ -61,6 +55,12 @@ class CRM_Upgrade_Incremental_php_FiveTwentyFour extends CRM_Upgrade_Incremental $this->addTask(ts('Upgrade DB to %1: SQL', [1 => $rev]), 'runSql', $rev); $this->addTask('Install sequential creditnote extension', 'installCreditNotes'); $this->addTask('Drop obsolete columns from saved_search table', 'dropSavedSearchColumns'); + $this->addTask('Smart groups: Add api_entity column to civicrm_saved_search', 'addColumn', + 'civicrm_saved_search', 'api_entity', "varchar(255) DEFAULT NULL COMMENT 'Entity name for API based search'" + ); + $this->addTask('Smart groups: Add api_params column to civicrm_saved_search', 'addColumn', + 'civicrm_saved_search', 'api_params', "text DEFAULT NULL COMMENT 'Parameters for API based search'" + ); } /** diff --git a/xml/schema/Contact/SavedSearch.xml b/xml/schema/Contact/SavedSearch.xml index e8437a08b9..89f578084b 100644 --- a/xml/schema/Contact/SavedSearch.xml +++ b/xml/schema/Contact/SavedSearch.xml @@ -91,4 +91,20 @@ 1.6 5.24 + + api_entity + varchar + Entity Name + 255 + Entity name for API based search + 5.24 + + + api_params + text + API Parameters + Parameters for API based search + JSON + 5.24 +