function DatabaseCacheTagsChecksum::schemaDefinition

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Cache/DatabaseCacheTagsChecksum.php \Drupal\Core\Cache\DatabaseCacheTagsChecksum::schemaDefinition()
  2. 8.9.x core/lib/Drupal/Core/Cache/DatabaseCacheTagsChecksum.php \Drupal\Core\Cache\DatabaseCacheTagsChecksum::schemaDefinition()
  3. 10 core/lib/Drupal/Core/Cache/DatabaseCacheTagsChecksum.php \Drupal\Core\Cache\DatabaseCacheTagsChecksum::schemaDefinition()

Defines the schema for the {cachetags} table.

@internal

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

File

core/lib/Drupal/Core/Cache/DatabaseCacheTagsChecksum.php, line 97

Class

DatabaseCacheTagsChecksum
Cache tags invalidations checksum implementation that uses the database.

Namespace

Drupal\Core\Cache

Code

public function schemaDefinition() {
    $schema = [
        'description' => 'Cache table for tracking cache tag invalidations.',
        'fields' => [
            'tag' => [
                'description' => 'Namespace-prefixed tag string.',
                'type' => 'varchar_ascii',
                'length' => 255,
                'not null' => TRUE,
                'default' => '',
            ],
            'invalidations' => [
                'description' => 'Number incremented when the tag is invalidated.',
                'type' => 'int',
                'not null' => TRUE,
                'default' => 0,
            ],
        ],
        'primary key' => [
            'tag',
        ],
    ];
    return $schema;
}

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