Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. DatabaseQueue.php

function DatabaseQueue::schemaDefinition

Defines the schema for the queue table.

@internal

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

File

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

Class

DatabaseQueue
Default queue implementation.

Namespace

Drupal\Core\Queue

Code

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.',
                'size' => 'big',
            ],
            'created' => [
                'type' => 'int',
                'not null' => TRUE,
                'default' => 0,
                'description' => 'Timestamp when the item was created.',
                'size' => 'big',
            ],
        ],
        'primary key' => [
            'item_id',
        ],
        'indexes' => [
            'name_created' => [
                'name',
                'created',
            ],
            'expire' => [
                'expire',
            ],
        ],
    ];
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal