function taxonomy_update_8002

Create a UUID column for taxonomy terms.

File

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

Code

function taxonomy_update_8002() {
  $spec = array(
    'description' => 'Unique Key: Universally unique identifier for this entity.',
    'type' => 'varchar',
    'length' => 128,
    'not null' => FALSE,
  );
  $keys = array(
    'unique keys' => array(
      'uuid' => array(
        'uuid',
      ),
    ),
  );

  // Account for sites having the contributed UUID module installed.
  if (db_field_exists('taxonomy_term_data', 'uuid')) {
    db_change_field('taxonomy_term_data', 'uuid', 'uuid', $spec, $keys);
  }
  else {
    db_add_field('taxonomy_term_data', 'uuid', $spec, $keys);
  }
}