function BatchStorage::schemaDefinition

Same name in this branch
  1. main core/lib/Drupal/Core/ProxyClass/Batch/BatchStorage.php \Drupal\Core\ProxyClass\Batch\BatchStorage::schemaDefinition()
Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/ProxyClass/Batch/BatchStorage.php \Drupal\Core\ProxyClass\Batch\BatchStorage::schemaDefinition()
  2. 11.x core/lib/Drupal/Core/Batch/BatchStorage.php \Drupal\Core\Batch\BatchStorage::schemaDefinition()
  3. 10 core/lib/Drupal/Core/ProxyClass/Batch/BatchStorage.php \Drupal\Core\ProxyClass\Batch\BatchStorage::schemaDefinition()
  4. 10 core/lib/Drupal/Core/Batch/BatchStorage.php \Drupal\Core\Batch\BatchStorage::schemaDefinition()
  5. 9 core/lib/Drupal/Core/ProxyClass/Batch/BatchStorage.php \Drupal\Core\ProxyClass\Batch\BatchStorage::schemaDefinition()
  6. 9 core/lib/Drupal/Core/Batch/BatchStorage.php \Drupal\Core\Batch\BatchStorage::schemaDefinition()
  7. 8.9.x core/lib/Drupal/Core/ProxyClass/Batch/BatchStorage.php \Drupal\Core\ProxyClass\Batch\BatchStorage::schemaDefinition()
  8. 8.9.x core/lib/Drupal/Core/Batch/BatchStorage.php \Drupal\Core\Batch\BatchStorage::schemaDefinition()

Defines the schema for the batch table.

@internal

1 call to BatchStorage::schemaDefinition()
BatchStorage::ensureTableExists in core/lib/Drupal/Core/Batch/BatchStorage.php
Check if the table exists and create it if not.

File

core/lib/Drupal/Core/Batch/BatchStorage.php, line 212

Class

BatchStorage
Defines the storage handler class for batches.

Namespace

Drupal\Core\Batch

Code

public function schemaDefinition() : Schema {
  $tables[] = new Table(name: static::TABLE_NAME, description: 'Stores details about batches (processes that run in multiple HTTP requests).', columns: [
    Column::serial(name: 'bid', description: 'Primary Key: Unique batch ID.'),
    Column::varcharAscii(name: 'token', description: "A string token generated against the current user's session id and the batch id, used to ensure that only the user who submitted the batch can effectively access it.", length: 64, notNull: TRUE),
    Column::int(name: 'timestamp', description: 'A Unix timestamp indicating when this batch was submitted for processing. Stale batches are purged at cron time.', notNull: TRUE),
    Column::blob(name: 'batch', description: 'A serialized array containing the processing data for the batch.', size: ColumnSize::Big, notNull: FALSE),
  ], primaryKey: new PrimaryKey([
    'bid',
  ]), indexes: [
    new Index(name: 'token', columns: [
      'token',
    ]),
  ]);
  return new Schema(type: SchemaDefinitionType::Storage, name: 'batch', tables: $tables);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.