You are here

function deploy_uuid_generate_files in Deploy - Content Staging 6

Generate uuids for any existing files at install-time

2 calls to deploy_uuid_generate_files()
deploy_uuid_install in modules/deploy_uuid/deploy_uuid.install
Implementation of hook_install().
deploy_uuid_update_6001 in modules/deploy_uuid/deploy_uuid.install

File

modules/deploy_uuid/deploy_uuid.install, line 151

Code

function deploy_uuid_generate_files() {
  $result = db_query("SELECT fid FROM {files}");
  while ($row = db_fetch_array($result)) {
    $uuid = uniqid(rand(), TRUE);
    db_query("INSERT INTO {files_uuid} (fid, uuid) values (%d, '%s')", $row['fid'], $uuid);
  }
}