diff -urp ../notifications/notifications.install notifications/notifications.install
--- ../notifications/notifications.install	2009-04-20 07:51:09.000000000 -0500
+++ notifications/notifications.install	2010-01-15 14:22:20.562747500 -0600
@@ -64,18 +64,18 @@ function notifications_schema() {
       ),
       'field' => array(
         'description' => 'The field type for this condition, will depend on subscription type and defined fields.',
-        'type' => 'varchar', 'length' => '255', 'not null' => TRUE
+        'type' => 'varchar', 'length' => '127', 'not null' => TRUE
       ),
       'value' => array(
         'description' => 'Matching value for the field, just for string values',
-        'type' => 'varchar', 'length' => '255', 'not null' => TRUE
+        'type' => 'varchar', 'length' => '127', 'not null' => TRUE
       ),
       'intval' => array(
         'description' => 'Matching value for the field, just for integer values',
         'type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '11'
       ),
     ),
-    'primary key' => array('sid', 'field'),
+    'primary key' => array('sid', 'field', 'value'),
   );
   $schema['notifications_event'] = array(
     'description' => 'Storage table for event parameters.',
@@ -373,4 +373,20 @@ function notifications_update_6003() {
 function notifications_update_6004() {
   drupal_get_schema(NULL, TRUE);
   return array();
+}
+
+/**
+ * Add the value field to the primary key and resize the field and value fields
+ * to avoid MySQL errors.
+ */  
+function notifications_update_6005() {
+  db_drop_primary_key($ret, 'notifications_fields');
+  db_change_field($ret, 'notifications_fields', 'field', 'field',
+    array('type' => 'varchar', 'length' => '127', 'not null' => TRUE)
+  );
+  db_change_field($ret, 'notifications_fields', 'value', 'value',
+    array('type' => 'varchar', 'length' => '127', 'not null' => TRUE)
+  );
+  db_add_primary_key($ret, 'notifications_fields', array('sid', 'field', 'value'));
+  return $ret;
 }
