1 taxonomy.install taxonomy_update_1006()

Add langcode column to {taxonomy_term_data} table.

Related topics

File

core/modules/taxonomy/taxonomy.install, line 337
Install, update and uninstall functions for the taxonomy module.

Code

function taxonomy_update_1006() {
  if (!db_field_exists('taxonomy_term_data', 'langcode')) {
    $spec = array(
      'description' => 'The language code for this term; if \'und\', the term will be shown in all languages.',
      'type' => 'varchar',
      'length' => 12,
      'not null' => TRUE,
      'default' => '',
    );
    db_add_field('taxonomy_term_data', 'langcode', $spec);
    db_query("UPDATE {taxonomy_term_data} SET langcode = 'und'");
  }
}