*
* Generated from xml/schema/CRM/Core/CustomField.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:492b1be45dc41c15b35371410a074393)
+ * (GenCodeChecksum:0b21a2a1f1cba7a76fd8830db1626513)
*/
/**
*/
public $option_group_id;
+ /**
+ * Serialization method - a non-null value indicates a multi-valued field.
+ *
+ * @var int
+ */
+ public $serialize;
+
/**
* Stores Contact Get API params contact reference custom fields. May be used for other filters in the future.
*
'labelColumn' => 'title',
],
],
+ 'serialize' => [
+ 'name' => 'serialize',
+ 'type' => CRM_Utils_Type::T_INT,
+ 'title' => ts('Serialize'),
+ 'description' => ts('Serialization method - a non-null value indicates a multi-valued field.'),
+ 'where' => 'civicrm_custom_field.serialize',
+ 'table_name' => 'civicrm_custom_field',
+ 'entity' => 'CustomField',
+ 'bao' => 'CRM_Core_BAO_CustomField',
+ 'localizable' => 0,
+ 'pseudoconstant' => [
+ 'callback' => 'CRM_Core_SelectValues::fieldSerialization',
+ ],
+ ],
'filter' => [
'name' => 'filter',
'type' => CRM_Utils_Type::T_STRING,
return $ret;
}
+ public static function fieldSerialization() {
+ return [
+ CRM_Core_DAO::SERIALIZE_SEPARATOR_BOOKEND => 'separator_bookend',
+ CRM_Core_DAO::SERIALIZE_SEPARATOR_TRIMMED => 'separator_trimmed',
+ CRM_Core_DAO::SERIALIZE_JSON => 'json',
+ CRM_Core_DAO::SERIALIZE_PHP => 'php',
+ CRM_Core_DAO::SERIALIZE_COMMA => 'comma',
+ ];
+ }
+
}
* (change the x in the function name):
*/
- // /**
- // * Upgrade function.
- // *
- // * @param string $rev
- // */
- // public function upgrade_5_0_x($rev) {
- // $this->addTask(ts('Upgrade DB to %1: SQL', [1 => $rev]), 'runSql', $rev);
- // $this->addTask('Do the foo change', 'taskFoo', ...);
- // // Additional tasks here...
- // // Note: do not use ts() in the addTask description because it adds unnecessary strings to transifex.
- // // The above is an exception because 'Upgrade DB to %1: SQL' is generic & reusable.
- // }
-
- // public static function taskFoo(CRM_Queue_TaskContext $ctx, ...) {
- // return TRUE;
- // }
+ /**
+ * Upgrade function.
+ *
+ * @param string $rev
+ */
+ public function upgrade_5_27_alpha1($rev) {
+ // Add column before running sql which populates the column's values
+ $this->addTask('Add serialize column to civicrm_custom_field', 'addColumn',
+ 'civicrm_custom_field', 'serialize', "int unsigned DEFAULT NULL COMMENT 'Serialization method - a non-null value indicates a multi-valued field.'"
+ );
+ $this->addTask(ts('Upgrade DB to %1: SQL', [1 => $rev]), 'runSql', $rev);
+ }
}
{* file to handle db changes in 5.27.alpha1 during upgrade *}
+UPDATE civicrm_custom_field SET serialize = 1, html_type = REPLACE(html_type, 'Multi-', '')
+WHERE html_type LIKE 'Multi-%' OR html_type = 'CheckBox';
+
ALTER TABLE `civicrm_contribution_recur` CHANGE `amount` `amount` DECIMAL( 20,2 ) COMMENT 'Amount to be collected (including any sales tax) by payment processor each recurrence.';
<add>5.6</add>
<onDelete>SET NULL</onDelete>
</foreignKey>
+ <field>
+ <name>serialize</name>
+ <type>int unsigned</type>
+ <title>Serialize</title>
+ <length>255</length>
+ <comment>Serialization method - a non-null value indicates a multi-valued field.</comment>
+ <pseudoconstant>
+ <callback>CRM_Core_SelectValues::fieldSerialization</callback>
+ </pseudoconstant>
+ <add>5.26</add>
+ </field>
<field>
<name>filter</name>
<type>varchar</type>