Answers.Body: <p>CiviCRM adds indexes to custom field only if its searchable(checkbox ticked for is searchable field). Removing it might impact performance if your system has lots of records but you won't notice if its only 1k to 10k records.</p>
  
  <p>But you trying to remove index which is not being used, so that should be fine.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-12T13:34:04.910Z
Answers.LastActivityDate: 2020-02-12T13:42:49.077Z
Answers.LastEditDate: 2020-02-12T13:42:49.077Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>We enabled multi language support in Civi 5.21.1 then tried to create a new custom field group with Select or Radio options. The error from the DB is below (***edit: This doesn't happen when adding fields to an existing Group):-</p>
  
  <pre><code>[db_error: message="DB Error: already exists" code=-5 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_custom_field (custom_group_id , name , label , data_type , html_type , default_value , is_required , is_searchable , is_search_range , weight , help_pre , help_post , is_active , is_view , options_per_line , text_length , start_date_years , end_date_years , date_format , time_format , note_columns , note_rows , column_name , option_group_id , filter , in_selector ) VALUES ( 77 , 'Test_2' , 'Test 2' , 'String' , 'Radio' ,  NULL ,  NULL ,  NULL ,  0 ,  2 ,  NULL ,  NULL ,  1 ,  NULL ,  NULL ,  255 ,  NULL ,  NULL ,  NULL ,  NULL ,  60 ,  4 , 'test_2' ,  204 ,  NULL ,  0 )  [nativecode=1062 ** Duplicate entry '77' for key 'UI_label_custom_group_id_en_GB']"]
  </code></pre>
  
  <p>After doing some digging, it seems that two tables now have additional keys:-</p>
  
  <p>custom_data_group has the key 'UI_title_extends_en_GB'
  custom_data_field has the key 'UI_label_custom_group_id_en_GB'</p>
  
  <p>After disabling multi language support, the keys remain and we are still unable to add options.</p>
  
  <p>Removing the keys from MySQL using the commands below resolves the error:-</p>
  
  <pre><code>alter table civicrm_custom_field drop index UI_label_custom_group_id_en_GB;
  </code></pre>
  
  <p>and for the group:-</p>
  
  <pre><code>alter table civicrm_custom_group drop index UI_title_extends_en_GB
  </code></pre>
  
  <p>Is it safe to enable multi language support without these keys?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-02-12T12:56:30.873Z
Comments.Text: I've noticed this error only happens when creating Select or Option fields within a new Custom Field Group. If you add them to an existing Group, the error is not present.
Comments.UserDisplayName: Darren
Tags: <custom-fields><multilingual>
Title: Is it safe to remove INDEX keys for multi language installation?
ThreadText: # Is it safe to remove INDEX keys for multi language installation?
  
  (Asked by: username_0 on 2020-02-12)
  
  We enabled multi language support in Civi 5.21.1 then tried to create a new custom field group with Select or Radio options. The error from the DB is below (\*\*\*edit: This doesn't happen when adding fields to an existing Group):-
  
  ```
  [db_error: message="DB Error: already exists" code=-5 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_custom_field (custom_group_id , name , label , data_type , html_type , default_value , is_required , is_searchable , is_search_range , weight , help_pre , help_post , is_active , is_view , options_per_line , text_length , start_date_years , end_date_years , date_format , time_format , note_columns , note_rows , column_name , option_group_id , filter , in_selector ) VALUES ( 77 , 'Test_2' , 'Test 2' , 'String' , 'Radio' ,  NULL ,  NULL ,  NULL ,  0 ,  2 ,  NULL ,  NULL ,  1 ,  NULL ,  NULL ,  255 ,  NULL ,  NULL ,  NULL ,  NULL ,  60 ,  4 , 'test_2' ,  204 ,  NULL ,  0 )  [nativecode=1062 ** Duplicate entry '77' for key 'UI_label_custom_group_id_en_GB']"]
  
  ```
  
  After doing some digging, it seems that two tables now have additional keys:-
  
  custom\_data\_group has the key 'UI\_title\_extends\_en\_GB'
  custom\_data\_field has the key 'UI\_label\_custom\_group\_id\_en\_GB'
  
  After disabling multi language support, the keys remain and we are still unable to add options.
  
  Removing the keys from MySQL using the commands below resolves the error:-
  
  ```
  alter table civicrm_custom_field drop index UI_label_custom_group_id_en_GB;
  
  ```
  
  and for the group:-
  
  ```
  alter table civicrm_custom_group drop index UI_title_extends_en_GB
  
  ```
  
  Is it safe to enable multi language support without these keys?
  
  **Tags:** custom-fields, multilingual
  
  > **Comments:**
  > **username_0**: I've noticed this error only happens when creating Select or Option fields within a new Custom Field Group. If you add them to an existing Group, the error is not present.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-02-12. Score: 1
  
  CiviCRM adds indexes to custom field only if its searchable(checkbox ticked for is searchable field). Removing it might impact performance if your system has lots of records but you won't notice if its only 1k to 10k records.
  
  But you trying to remove index which is not being used, so that should be fine.
  
  
  ---
  
  