Index: galleryapi.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/galleryapi/galleryapi.install,v
retrieving revision 1.2
diff -u -p -r1.2 galleryapi.install
--- galleryapi.install	19 Oct 2009 12:04:06 -0000	1.2
+++ galleryapi.install	11 Jul 2010 04:09:29 -0000
@@ -10,7 +10,7 @@
  * Implementation of hook_install().
  */
 function galleryapi_install() {
-  // Create tables.  
+  // Create tables.
   drupal_install_schema('galleryapi');
 }
 
@@ -36,8 +36,8 @@ function galleryapi_schema() {
         'not null' => TRUE
       ),
       'input_data' => array(
-        'type' => 'text',
-        'not null' => TRUE,
+        'type' => 'blob',
+        'not null' => FALSE,
         'size' => 'big',
         'serialize' => TRUE
       ),
@@ -47,17 +47,20 @@ function galleryapi_schema() {
         'not null' => TRUE
       ),
       'output_data' => array(
-        'type' => 'text',
-        'not null' => TRUE,
+        'type' => 'blob',
+        'not null' => FALSE,
         'size' => 'big',
         'serialize' => TRUE,
-      ),      
-    ),    
+      ),
+    ),
     'primary key' => array('pid'),
+    'unique keys' => array(
+      'name' => array('name'),
+    ),
   );
-  
+
   //$schema['cache_galleryapi'] = drupal_get_schema_unprocessed('system', 'cache');
-  
+
   return $schema;
 }
 
@@ -67,4 +70,21 @@ function galleryapi_schema() {
 function galleryapi_uninstall() {
   // Remove tables.
   drupal_uninstall_schema('galleryapi');
-}
\ No newline at end of file
+}
+
+/**
+ * Converts fields that store serialized variables from text to blob.
+ */
+function galleryapi_update_6000() {
+  $ret = array();
+  $spec = array(
+    'type' => 'blob',
+    'not null' => FALSE,
+    'size' => 'big',
+  );
+  db_change_field($ret, 'galleryapi_presets', 'input_data', 'input_data', $spec);
+  db_change_field($ret, 'galleryapi_presets', 'output_data', 'output_data', $spec);
+  // Add unique key for preset name.
+  db_add_unique_key($ret, 'galleryapi_presets', 'name', array('name'));
+  return $ret;
+}
