Create a UUID column for nodes.
function node_update_8004() {
$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('node', 'uuid')) {
db_change_field('node', 'uuid', 'uuid', $spec, $keys);
}
else {
db_add_field('node', 'uuid', $spec, $keys);
}
}