CRM-13655 - GenCode - Allow overriding COLLATE for specific columns
authorTim Otten <totten@civicrm.org>
Sun, 27 Oct 2013 14:44:00 +0000 (07:44 -0700)
committerTim Otten <totten@civicrm.org>
Sun, 27 Oct 2013 14:44:00 +0000 (07:44 -0700)
----------------------------------------
* CRM-13655: WordReplacement - Uniqueness key should allow different cases and domains
  http://issues.civicrm.org/jira/browse/CRM-13655

xml/GenCode.php
xml/templates/schema.tpl

index 043850e92eb05b12fff3287c3d7dd95517f72ab1..75ec81747bb02014838b281b4be1003fb49a2a24 100644 (file)
@@ -688,6 +688,7 @@ Alternatively you can get a version of CiviCRM that matches your PHP version
     }
 
     $field['required'] = $this->value('required', $fieldXML);
+    $field['collate']  = $this->value('collate', $fieldXML);
     $field['comment']  = $this->value('comment', $fieldXML);
     $field['default']  = $this->value('default', $fieldXML);
     $field['import']   = $this->value('import', $fieldXML);
index a42defbd6af6db1b9be01e97e6f07d04f6b1bf7d..dd0d4ab143bb76efdaaab2bb9213a2ee1ab651f5 100644 (file)
@@ -52,7 +52,7 @@ CREATE TABLE `{$table.name}` (
 {if ! $first},{/if}
 {assign var='first' value=false}
 
-     `{$field.name}` {$field.sqlType} {if $field.required}{if $field.required == "false"}NULL{else}NOT NULL{/if}{/if} {if $field.autoincrement}AUTO_INCREMENT{/if} {if $field.default|count_characters}DEFAULT {$field.default}{/if} {if $field.comment}COMMENT '{$field.comment}'{/if}
+     `{$field.name}` {$field.sqlType}{if $field.collate} COLLATE {$field.collate}{/if} {if $field.required}{if $field.required == "false"}NULL{else}NOT NULL{/if}{/if} {if $field.autoincrement}AUTO_INCREMENT{/if} {if $field.default|count_characters}DEFAULT {$field.default}{/if} {if $field.comment}COMMENT '{$field.comment}'{/if}
 {/foreach} {* table.fields *}
 
 {if $table.primaryKey}