You are here

function deploy_uuid_generate_terms in Deploy - Content Staging 6

Generate uuids for any existing taxonomy terms at install-time

1 call to deploy_uuid_generate_terms()
deploy_uuid_install in modules/deploy_uuid/deploy_uuid.install
Implementation of hook_install().

File

modules/deploy_uuid/deploy_uuid.install, line 173

Code

function deploy_uuid_generate_terms() {
  $result = db_query("SELECT tid FROM {term_data}");
  while ($row = db_fetch_array($result)) {
    $uuid = uniqid(rand(), TRUE);
    db_query("INSERT INTO {term_data_uuid} (tid, uuid) values (%d, '%s')", $row['tid'], $uuid);
  }
}