You are here

function update_create_batch_table in Drupal 6

Create the batch table.

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

1 call to update_create_batch_table()
update.php in ./update.php
Administrative page for handling updates from one Drupal version to another.

File

./update.php, line 403
Administrative page for handling updates from one Drupal version to another.

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;
}