You are here

function deploy_uuid_generate_comments in Deploy - Content Staging 6

Generate uuids for any existing comments at install-time

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

File

modules/deploy_uuid/deploy_uuid.install, line 195

Code

function deploy_uuid_generate_comments() {
  $result = db_query("SELECT cid FROM {comments}");
  while ($row = db_fetch_array($result)) {
    $uuid = uniqid(rand(), TRUE);
    db_query("INSERT INTO {comments_uuid} (cid, uuid) values (%d, '%s')", $row['cid'], $uuid);
  }
}