function update_create_batch_table

8.0.x update_6.inc update_create_batch_table()
6.x update_6.inc update_create_batch_table()
7.x update_6.inc update_create_batch_table()
3.x update_6.inc update_create_batch_table()
4.x update_6.inc update_create_batch_table()
5.x update_6.inc update_create_batch_table()

Create the batch table.

This is part of the Drupal 5.x to 6.x migration.

1 call to update_create_batch_table()
update_main_prepare in commands/core/drupal/update_6.inc

File

commands/core/drupal/update_6.inc, line 253
Update.php for provisioned sites. This file is a derivative of the standard drupal update.php, which has been modified to allow being run from the command line.

Code

function update_create_batch_table() {

  // If batch table exists, update is not necessary
  if (db_table_exists('batch')) {
    return;
  }

  $schema['batch'] = array(
    'fields' => array(
      'bid' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'token' => array(
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
      ),
      'timestamp' => array(
        'type' => 'int',
        'not null' => TRUE,
      ),
      'batch' => array(
        'type' => 'text',
        'not null' => FALSE,
        'size' => 'big',
      ),
    ),
    'primary key' => array('bid'),
    'indexes' => array('token' => array('token')),
  );

  $ret = array();
  db_create_table($ret, 'batch', $schema['batch']);
  return $ret;
}