--- imagefield.install.old	2007-04-18 23:02:19.000000000 +0200
+++ imagefield.install	2008-06-30 12:37:20.000000000 +0200
@@ -74,5 +74,41 @@ function imagefield_update_2() {
 }
 
 
+/**
+ * Schema change to enable longdesc tag and decorative flag.
+ */
 
+function imagefield_update_3() {
+  $ret = array();
+
+  include_once(drupal_get_path('module', 'content') .'/content.module');
+  include_once(drupal_get_path('module', 'content') .'/content_admin.inc');
+
+  $fields = content_fields();
+
+  foreach ($fields as $field) {
+    switch ($field['type']) {
+      case 'image':
+        $oldcolumns = array(
+          'fid' => array('type' => 'int', 'not null' => TRUE, 'default' => '0'),
+          'title' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => "''", 'sortable' => TRUE),
+          'alt' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => "''", 'sortable' => TRUE),
+        );
+        $newcolumns = array(
+          'fid' => array('type' => 'int', 'not null' => TRUE, 'default' => '0'),
+          'title' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => "''", 'sortable' => TRUE),
+          'alt' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => "''", 'sortable' => TRUE),
+          'longdesc' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => "''", 'sortable' => TRUE),
+          'decorative' => array('type' => 'bool', 'not null' => TRUE, 'default' => FALSE),
+        );
+        content_alter_db_field($field, $oldcolumns, $field, $newcolumns);
+        break;
+    }
+    drupal_set_message('altered: <br /><pre>'. print_r($field, true) .'</pre>');
+  }
+
+
+  db_query('DELETE FROM {cache}');
+  return $ret;
+}
 
