function deploy_uuid_generate_nodes in Deploy - Content Staging 6
Generate uuids for any existing nodes at install-time
1 call to deploy_uuid_generate_nodes()
- deploy_uuid_install in modules/
deploy_uuid/ deploy_uuid.install - Implementation of hook_install().
File
- modules/
deploy_uuid/ deploy_uuid.install, line 140
Code
function deploy_uuid_generate_nodes() {
$result = db_query("SELECT nid FROM {node}");
while ($row = db_fetch_array($result)) {
$uuid = uniqid(rand(), TRUE);
db_query("INSERT INTO {node_uuid} (nid, uuid) values (%d, '%s')", $row['nid'], $uuid);
}
}