Index: imagecache.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/imagecache/imagecache.install,v
retrieving revision 1.22
diff -u -p -r1.22 imagecache.install
--- imagecache.install	22 Dec 2008 00:01:19 -0000	1.22
+++ imagecache.install	22 Dec 2008 21:52:40 -0000
@@ -244,3 +244,25 @@ function imagecache_update_5() {
 
   return array();
 }
+
+/**
+ * Upgrade from Drupal 5 => Drupal 6.
+ * Add the module field to imagecache_action
+ */
+function imagecache_update_6000() {
+  $ret = array();
+  
+  // Update primary keys to serial type for Drupal 6
+  $tables = array(
+    'imagecache_preset' => 'presetid',
+    'imagecache_action' => 'actionid',
+  );
+  foreach ($tables as $table => $field) {
+    db_drop_primary_key($ret, $table);
+    db_change_field($ret, $table, $field, $field, array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), array('primary key' => array($field)));
+  }
+  db_query('DELETE FROM {sequences} WHERE name = "{imagecache_preset}_presetid"');
+  db_query('DELETE FROM {sequences} WHERE name = "{imagecache_action}_actionid"');
+  
+  return $ret;
+}
