diff --git a/core/modules/simpletest/simpletest.install b/core/modules/simpletest/simpletest.install index df19ccc..524ceff 100644 --- a/core/modules/simpletest/simpletest.install +++ b/core/modules/simpletest/simpletest.install @@ -190,8 +190,74 @@ function simpletest_update_8102() { 'description' => 'The name of the class that created this message.', ); $schema = Database::getConnection()->schema(); + // Index 'reporter' uses 'test_class', so remove and recreate it. + $schema->dropIndex('simpletest', 'reporter'); $schema->changeField('simpletest', 'test_class', 'test_class', $simpletest_test_class); - + // Spec of the table once we've done the two previous operations. We need + // this to recreate the index. + $spec = array( + 'description' => 'Stores simpletest messages', + 'fields' => array( + 'message_id' => array( + 'type' => 'serial', + 'not null' => TRUE, + 'description' => 'Primary Key: Unique simpletest message ID.', + ), + 'test_id' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'description' => 'Test ID, messages belonging to the same ID are reported together', + ), + 'test_class' => array( + 'type' => 'text', + 'not null' => TRUE, + 'description' => 'The name of the class that created this message.', + ), + 'status' => array( + 'type' => 'varchar', + 'length' => 9, + 'not null' => TRUE, + 'default' => '', + 'description' => 'Message status. Core understands pass, fail, exception.', + ), + 'message' => array( + 'type' => 'text', + 'not null' => TRUE, + 'description' => 'The message itself.', + ), + 'message_group' => array( + 'type' => 'varchar_ascii', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + 'description' => 'The message group this message belongs to. For example: warning, browser, user.', + ), + 'function' => array( + 'type' => 'varchar_ascii', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + 'description' => 'Name of the assertion function or method that created this message.', + ), + 'line' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'description' => 'Line number on which the function is called.', + ), + 'file' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + 'description' => 'Name of the file where the function is called.', + ), + ), + 'primary key' => array('message_id'), + ); + $schema->addIndex('simpletest', 'reporter', array(array('test_class', 255), 'message_id'), $spec); + $simpletest_function = array( 'type' => 'text', 'not null' => TRUE,