? .cvsignore
? 690746_serialized_fields_to_blobs.patch
? 837832_0.patch
Index: head2head.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/head2head/head2head.module,v
retrieving revision 1.40
diff -u -p -r1.40 head2head.module
--- head2head.module	15 Sep 2010 22:17:33 -0000	1.40
+++ head2head.module	21 Sep 2010 14:09:21 -0000
@@ -7,6 +7,22 @@
  */
 
 /**
+ * Helper function to see if a module has been installed.
+ *
+ * This is used to conditionally run update functions only when the module they are updating has been installed
+ * and therefor has created its tables.
+ */
+function _head2head_module_installed($module) {
+  $query = db_select('system', 's')
+    ->fields('s')
+    ->condition('schema_version', -1, '!=')
+    ->condition('name', $module)
+    ->condition('type', 'module');
+  if ($query->countQuery()->execute()->fetchField()) {
+    return TRUE;
+  }
+}
+/**
  * Increase size of init field on users table to 254 characters.
  */
 function head2head_809132() {
@@ -563,6 +579,9 @@ function head2head_812688() {
  * Update type field on search tables to be NOT NULL.
  */
 function head2head_853896() {
+  if (!_head2head_module_installed('search')) {
+    return;
+  }
   db_drop_primary_key('search_dataset');
   $dataset_type_spec = array(
     'type' => 'varchar',
