Index: contrib/image_attach/image_attach.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/image/contrib/image_attach/image_attach.install,v
retrieving revision 1.13
diff -u -p -r1.13 image_attach.install
--- contrib/image_attach/image_attach.install	13 Jan 2009 09:32:25 -0000	1.13
+++ contrib/image_attach/image_attach.install	17 Jan 2009 23:39:26 -0000
@@ -9,18 +9,24 @@ function image_attach_schema() {
     'description' => 'Stores the image/node relationship.',
     'fields' => array(
       'nid' => array(
-        'description' => 'Primary Key: The {node}.nid of the node.',
+        'description' => 'The {node}.nid of the node.',
         'type' => 'int',
+        'unsigned' => TRUE,
         'not null' => TRUE,
         'default' => 0,
       ),
       'iid' => array(
-        'description' => 'TODO',
+        'description' => 'The {image}.nid of the image file.',
         'type' => 'int',
+        'unsigned' => TRUE,
         'not null' => TRUE,
         'default' => 0,
       ),
     ),
+    'primary key' => array('nid'),
+    'indexes' => array(
+      'iid' => array('iid'),
+    ),
   );
   return $schema;
 }
@@ -76,3 +82,26 @@ function image_attach_update_2() {
   }
   return $ret;
 }
+
+/**
+ * Add primary key and index on 'iid' to {image_attach} table.
+ */
+function image_attach_update_6100() {
+  $ret = array();
+  db_change_field($ret, 'image_attach', 'nid', 'nid', array(
+    'type' => 'int',
+    'unsigned' => TRUE,
+    'not null' => TRUE,
+    'default' => 0,
+  ));
+  db_change_field($ret, 'image_attach', 'iid', 'iid', array(
+    'type' => 'int',
+    'unsigned' => TRUE,
+    'not null' => TRUE,
+    'default' => 0,
+  ));
+  db_add_primary_key($ret, 'image_attach', array('nid'));
+  db_add_index($ret, 'image_attach', 'iid', array('iid'));
+  return $ret;
+}
+
