Index: uuid.install
===================================================================
RCS file: /cvs/drupal/contributions/modules/uuid/uuid.install,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 uuid.install
--- uuid.install	1 Sep 2009 02:00:38 -0000	1.1.2.3
+++ uuid.install	8 Sep 2009 07:47:35 -0000
@@ -25,6 +25,8 @@
     'uuid_node' => uuid_table_schema('node', 'nid'),
     'uuid_users' => uuid_table_schema('users', 'uid'),
     'uuid_node_revisions' => uuid_table_schema('node_revisions', 'vid'),
+    'uuid_vocabulary' => uuid_table_schema('vocabulary', 'vid'),
+    'uuid_term_data' => uuid_table_schema('term_data', 'tid'),
   );
 }
 
Index: uuid.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/uuid/uuid.module,v
retrieving revision 1.1.2.4
diff -u -r1.1.2.4 uuid.module
--- uuid.module	11 Jun 2009 18:07:13 -0000	1.1.2.4
+++ uuid.module	8 Sep 2009 07:54:07 -0000
@@ -163,6 +163,35 @@
 }
 
 /**
+ * Implementation of hook_taxonomy().
+ */
+function uuid_taxonomy($op, $type, $array = NULL) {
+  $types = array(
+    'term' => array(
+      'table' => 'uuid_term_data',
+      '$field' => 'tid',
+    ),
+    'vocabulary' => array(
+      'table' => 'uuid_vocabulary',
+      '$field' => 'vid',
+    ),
+  );
+  
+  if (array_key_exists($type, $types) && in_array($array['vid'], variable_get('uuid_automatic_for_taxonomy', array()))) {
+    $field = $types[$type]['$field'];
+    switch ($op) {
+      case 'insert':
+        db_query("INSERT INTO {" . $types[$type]['table'] . "} ($field, uuid) VALUES (%d, UUID())",
+          $array[$types[$type]['$field']]);
+        break;
+      case 'delete':
+        db_query("DELETE FROM {". $types[$type]['table'] ."} WHERE $field = %d", $array[$types[$type]['$field']]);
+        break;
+    }
+  }
+}
+
+/**
  * Determines if a UUID is valid.
  */
 function uuid_is_valid($uuid) {

