? 780358-7_fix-change_errors.patch
? 866476-1_CTools1.7.patch
? 866476-6_CTools1.7.patch
Index: data.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/data/data.install,v
retrieving revision 1.9
diff -u -p -r1.9 data.install
--- data.install	27 Jul 2009 23:27:22 -0000	1.9
+++ data.install	28 Jul 2010 20:33:28 -0000
@@ -32,7 +32,7 @@ function data_schema() {
       ),
       'name' => array(
         'type' => 'varchar',
-        'length' => '255',
+        'length' => '128',
         'not null' => TRUE,
         'default' => '',
         'description' => 'Table name.',
@@ -50,9 +50,7 @@ function data_schema() {
         'serialize' => TRUE,
       ),
     ),
-    'indexes' => array(
-        'name' => array('name'),
-      ),
+    'primary key' => array('name'),
   );
   return $schema;
 }
@@ -86,4 +84,22 @@ function data_update_6001() {
   }
   db_drop_table($ret, 'data_join');
   return $ret;
-}
\ No newline at end of file
+}
+
+/**
+ * Add a primary key, required by CTools. Shorten name key to 128 char max.
+ */
+function data_update_6002() {
+  $ret = array();
+  db_drop_index($ret, 'data_tables', 'name');
+  $spec = array(
+    'type' => 'varchar',
+    'length' => '128',
+    'not null' => TRUE,
+    'default' => '',
+    'description' => 'Table name.',
+  );
+  db_change_field($ret, 'data_tables', 'name', 'name', $spec);
+  db_add_primary_key($ret, 'data_tables', array('name'));
+  return $ret;
+}
