function DatabaseStorage::schemaDefinition

Same name in this branch
  1. 10 core/lib/Drupal/Core/KeyValueStore/DatabaseStorage.php \Drupal\Core\KeyValueStore\DatabaseStorage::schemaDefinition()
Same name in other branches
  1. 9 core/lib/Drupal/Core/Config/DatabaseStorage.php \Drupal\Core\Config\DatabaseStorage::schemaDefinition()
  2. 9 core/lib/Drupal/Core/KeyValueStore/DatabaseStorage.php \Drupal\Core\KeyValueStore\DatabaseStorage::schemaDefinition()
  3. 8.9.x core/lib/Drupal/Core/Config/DatabaseStorage.php \Drupal\Core\Config\DatabaseStorage::schemaDefinition()
  4. 11.x core/lib/Drupal/Core/Config/DatabaseStorage.php \Drupal\Core\Config\DatabaseStorage::schemaDefinition()
  5. 11.x core/lib/Drupal/Core/KeyValueStore/DatabaseStorage.php \Drupal\Core\KeyValueStore\DatabaseStorage::schemaDefinition()

Defines the schema for the configuration table.

@internal

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

File

core/lib/Drupal/Core/Config/DatabaseStorage.php, line 198

Class

DatabaseStorage
Defines the Database storage.

Namespace

Drupal\Core\Config

Code

protected static function schemaDefinition() {
    $schema = [
        'description' => 'The base table for configuration data.',
        'fields' => [
            'collection' => [
                'description' => 'Primary Key: Config object collection.',
                'type' => 'varchar_ascii',
                'length' => 255,
                'not null' => TRUE,
                'default' => '',
            ],
            'name' => [
                'description' => 'Primary Key: Config object name.',
                'type' => 'varchar_ascii',
                'length' => 255,
                'not null' => TRUE,
                'default' => '',
            ],
            'data' => [
                'description' => 'A serialized configuration object data.',
                'type' => 'blob',
                'not null' => FALSE,
                'size' => 'big',
            ],
        ],
        'primary key' => [
            'collection',
            'name',
        ],
    ];
    return $schema;
}

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