DatabaseQueue::schemaDefinition

public DatabaseQueue::schemaDefinition()

Defines the schema for the queue table.

File

core/lib/Drupal/Core/Queue/DatabaseQueue.php, line 281

Class

DatabaseQueue
Default queue implementation.

Namespace

Drupal\Core\Queue

Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
public function schemaDefinition() {
  return [
    'description' => 'Stores items in queues.',
    'fields' => [
      'item_id' => [
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => 'Primary Key: Unique item ID.',
      ],
      'name' => [
        'type' => 'varchar_ascii',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
        'description' => 'The queue name.',
      ],
      'data' => [
        'type' => 'blob',
        'not null' => FALSE,
        'size' => 'big',
        'serialize' => TRUE,
        'description' => 'The arbitrary data for the item.',
      ],
      'expire' => [
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'Timestamp when the claim lease expires on the item.',
      ],
      'created' => [
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'Timestamp when the item was created.',
      ],
    ],
    'primary key' => ['item_id'],
    'indexes' => [
      'name_created' => ['name', 'created'],
      'expire' => ['expire'],
    ],
  ];
}
doc_Drupal
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.