Index: simpletest.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simpletest/simpletest.install,v
retrieving revision 1.4.2.3.2.12
diff -u -r1.4.2.3.2.12 simpletest.install
--- simpletest.install	23 Sep 2008 04:53:40 -0000	1.4.2.3.2.12
+++ simpletest.install	22 Nov 2008 11:47:53 -0000
@@ -233,30 +233,95 @@
 }
 
 /**
- * Correct column name.
+ * Upgrade simpletest to 6.x-2.x releases. This does *not* fix update_7000 issues from 6.x-2.1 release.
  */
 function simpletest_update_6000() {
   $ret = array();
   $schema = array();
 
+  // Upgrade to 6.x-2.x.
+  $schema['simpletest'] = array(
+    'description' => t('Stores simpletest messages'),
+    'fields' => array(
+      'message_id'  => array(
+        'type' => 'serial',
+        'not null' => TRUE,
+        'description' => t('Primary Key: Unique simpletest message ID.'),
+      ),
+      'test_id' => array(
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+        'description' => t('Test ID, messages belonging to the same ID are reported together'),
+      ),
+      'test_class' => array(
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => TRUE,
+        'default' => '',
+        'description' => t('The name of the class that created this message.'),
+      ),
+      'status' => array(
+        'type' => 'varchar',
+        'length' => 9,
+        'not null' => TRUE,
+        'default' => '',
+        'description' => t('Message status. Core understands pass, fail, exception.'),
+      ),
+      'message' => array(
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => TRUE,
+        'default' => ''
+        'description' => t('The message itself.'),
+      ),
+      'message_group' => array(
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => TRUE,
+        'default' => '',
+        'description' => t('The message group this message belongs to. For example: warning, browser, user.'),
+      ),
+      'caller' => array(
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => TRUE,
+        'default' => '',
+        'description' => t('Name of the caller function or method that created this message.'),
+      ),
+      'line' => array(
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+        'description' => t('Line number on which the function is called.'),
+      ),
+      'file' => array(
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => TRUE,
+        'default' => '',
+        'description' => t('Name of the file where the function is called.'),
+      ),
+    ),
+    'primary key' => array('message_id'),
+    'indexes' => array(
+      'reporter' => array('test_class', 'message_id'),
+    ),
+  );
   $schema['simpletest_test_id'] = array(
     'description' => t('Stores simpletest test IDs, used to auto-incrament the test ID so that a fresh test ID is used.'),
     'fields' => array(
       'test_id'  => array(
         'type' => 'serial',
         'not null' => TRUE,
-        'description' => t('Primary Key: Unique simpletest ID used to group test results together. Each time a set of tests
-                            are run a new test ID is used.')
+        'description' => t('Primary Key: Unique simpletest ID used to group test results together. Each time a set of tests are run a new test ID is used.')
       )
     ),
     'primary key' => array('test_id')
   );
 
-  // Clear test results to prevent conflict.
-  db_query('DELETE FROM {simpletest}');
-
-  // Replace old table with new to make sure primary keys and such are fixed.
-  db_drop_table($ret, 'simpletest_test_id');
+  // Install non-existent tables.
+  db_create_table($ret, 'simpletest', $schema['simpletest']);
   db_create_table($ret, 'simpletest_test_id', $schema['simpletest_test_id']);
 
   return $ret;
