Skip to content

Commit

Permalink
extending the @wannesderoy patch from civicrm#18920
Browse files Browse the repository at this point in the history
  • Loading branch information
bjendres committed Mar 31, 2021
1 parent cda4a31 commit 31c5844
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CRM/Export/BAO/ExportProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -1454,12 +1454,16 @@ public function getSqlColumnDefinition($fieldName, $columnName) {
if ($type) {
switch ($type) {
case CRM_Utils_Type::T_INT:
case CRM_Utils_Type::T_BOOLEAN:
if (in_array(CRM_Utils_Array::value('data_type', $fieldSpec), ['Country', 'StateProvince', 'ContactReference'])) {
return "`$fieldName` varchar(255)";
}
return "`$fieldName` varchar(16)";

case CRM_Utils_Type::T_BOOLEAN:
// some of those will be exported as a (localisable) string
// @see https://lab.civicrm.org/dev/core/-/issues/2164
return "`$fieldName` varchar(64)";

case CRM_Utils_Type::T_STRING:
if (isset($fieldSpec['maxlength'])) {
return "`$fieldName` varchar({$fieldSpec['maxlength']})";
Expand Down

0 comments on commit 31c5844

Please sign in to comment.