Index: head2head.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/head2head/head2head.module,v
retrieving revision 1.46
diff -u -p -r1.46 head2head.module
--- head2head.module	7 Oct 2010 12:14:31 -0000	1.46
+++ head2head.module	7 Oct 2010 22:10:50 -0000
@@ -730,3 +730,35 @@ function head2head_895176() {
     drupal_set_installed_schema_version($module, 7062);
   }
 }
+
+/**
+ * Update for foreign key support added to field schema and core field modules.
+ */
+function head2head_915168() {
+  $result = db_query("SELECT id, module, data FROM {field_config}");
+  foreach ($result as $record) {
+    $data = unserialize($record->data);
+    if (!isset($data['foreign keys'])) {
+      if ($record->module == 'text') {
+        $data['foreign keys'] = array(
+          'format' => array(
+            'table' => 'filter_format',
+            'columns' => array('format' => 'format'),
+          ),
+        );
+      }
+      elseif ($record->module == 'file') {
+        $data['foreign keys'] = array(
+          'fid' => array(
+            'table' => 'file',
+            'columns' => array('fid' => 'fid'),
+          ),
+        );
+      }
+      else {
+        $data['foreign keys'] = array();
+      }
+      db_query("UPDATE {field_config} SET data = :data WHERE id = :id", array(':data' => serialize($data), ':id' => $record->id));
+    }
+  }
+}
Index: alpha2alpha/alpha2alpha.install
===================================================================
RCS file: /cvs/drupal/contributions/modules/head2head/alpha2alpha/alpha2alpha.install,v
retrieving revision 1.30
diff -u -p -r1.30 alpha2alpha.install
--- alpha2alpha/alpha2alpha.install	4 Oct 2010 20:50:45 -0000	1.30
+++ alpha2alpha/alpha2alpha.install	7 Oct 2010 22:10:50 -0000
@@ -318,11 +318,21 @@ function alpha2alpha_update_7802() {
   alpha2alpha_update_helper('909338', 8, array('locale'));
 }
 
+/**
+ * Update database schema and existing data for tables storing format data.
+ */
 function alpha2alpha_update_7803() {
   alpha2alpha_update_helper('358437', 8);
 }
 
 /**
+ * Update for foreign key support added to field schema and core field modules.
+ */
+function alpha2alpha_update_7804() {
+  alpha2alpha_update_helper('915168', 8);
+}
+
+/**
  * @} End of "defgroup updates-alpha-7-to-8"
  * The next series of updates should start at 7900.
  */
