function layout_builder_schema

Same name and namespace in other branches
  1. 9 core/modules/layout_builder/layout_builder.install \layout_builder_schema()
  2. 8.9.x core/modules/layout_builder/layout_builder.install \layout_builder_schema()
  3. 10 core/modules/layout_builder/layout_builder.install \layout_builder_schema()

Implements hook_schema().

File

core/modules/layout_builder/layout_builder.install, line 46

Code

function layout_builder_schema() {
    $schema['inline_block_usage'] = [
        'description' => 'Track where a block_content entity is used.',
        'fields' => [
            'block_content_id' => [
                'description' => 'The block_content entity ID.',
                'type' => 'int',
                'unsigned' => TRUE,
                'not null' => TRUE,
            ],
            'layout_entity_type' => [
                'description' => 'The entity type of the parent entity.',
                'type' => 'varchar_ascii',
                'length' => EntityTypeInterface::ID_MAX_LENGTH,
                'not null' => FALSE,
                'default' => '',
            ],
            'layout_entity_id' => [
                'description' => 'The ID of the parent entity.',
                'type' => 'varchar_ascii',
                'length' => 128,
                'not null' => FALSE,
                'default' => 0,
            ],
        ],
        'primary key' => [
            'block_content_id',
        ],
        'indexes' => [
            'type_id' => [
                'layout_entity_type',
                'layout_entity_id',
            ],
        ],
    ];
    return $schema;
}

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