// If another process has already created the batch table, attempting to
// recreate it will throw an exception. In this case just catch the
@@ -204,39 +209,44 @@ protected function catchException(\Exception $e) {
*
* @internal
*/
publicfunctionschemaDefinition(){
return[
'description'=>'Stores details about batches (processes that run in multiple HTTP requests).',
'fields'=>[
'bid'=>[
'description'=>'Primary Key: Unique batch ID.',
'type'=>'serial',
'unsigned'=>TRUE,
'not null'=>TRUE,
publicfunctionschemaDefinition():Schema{
$tables[]=newTable(
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,
),
],
'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.",
'type'=>'varchar_ascii',
'length'=>64,
'not null'=>TRUE,
primaryKey:newPrimaryKey(['bid']),
indexes:[
newIndex(name:'token',columns:['token']),
],
'timestamp'=>[
'description'=>'A Unix timestamp indicating when this batch was submitted for processing. Stale batches are purged at cron time.',
'type'=>'int',
'not null'=>TRUE,
],
'batch'=>[
'description'=>'A serialized array containing the processing data for the batch.',