You are here

public function UniqueDatabaseQueue::schemaDefinition in Queue Unique 8.2

Defines the schema for the queue table.

@internal

Overrides DatabaseQueue::schemaDefinition

File

src/UniqueDatabaseQueue.php, line 73

Class

UniqueDatabaseQueue
Database queue implementation which only adds unique items.

Namespace

Drupal\queue_unique

Code

public function schemaDefinition() {
  return array_merge_recursive(parent::schemaDefinition(), [
    'fields' => [
      'hash' => [
        'type' => 'char',
        'length' => static::HASH_COL_LENGTH,
        'not null' => TRUE,
      ],
    ],
    'unique keys' => [
      'unique' => [
        'hash',
      ],
    ],
  ]);
}