1 simpletest.install simpletest_update_1000()

Update the simpletest_test_id table to hold a list of active prefixes.

Related topics

File

core/modules/simpletest/simpletest.install, line 190
Install, update and uninstall functions for the simpletest module.

Code

function simpletest_update_1000() {
  if (db_table_exists('simpletest_test_id')) {
    db_drop_table('simpletest_test_id');
  }
  if (!db_table_exists('simpletest_prefix')) {
    $schema = array(
      'description' => 'Stores simpletest test IDs and active database table prefixes.',
      'fields' => array(
        'test_id' => array(
          'type' => 'int',
          'not null' => TRUE,
          'unsigned' => TRUE,
          'description' => 'Unique simpletest ID used to group test results together.',
        ),
        'prefix' => array(
          'type' => 'varchar',
          'length' => 60,
          'not null' => FALSE,
          'default' => '',
          'description' => 'The database prefix used during testing. Multiple prefixes may be used at the same time if using the run-scripts.sh script with concurrency.',
        ),
      ),
      'indexes' => array(
        'test_id' => array('test_id'),
        'prefix' => array('prefix'),
      ),
    );
    db_create_table('simpletest_prefix', $schema);
  }
}