function simple_sitemap_update_8303 in Simple XML sitemap 4.x
Same name and namespace in other branches
- 8.3 simple_sitemap.install \simple_sitemap_update_8303()
Add indexes to the simple_sitemap and simple_sitemap_entity_overrides tables.
File
- ./
simple_sitemap.install, line 735 - Module install and update procedures.
Code
function simple_sitemap_update_8303() {
$schema = Drupal\Core\Database\Database::getConnection()
->schema();
$spec = [
'fields' => [
'type' => [
'description' => 'Type of sitemap this chunk belongs to.',
'type' => 'varchar',
'length' => 50,
'not null' => TRUE,
'default' => '',
],
'delta' => [
'description' => 'Delta of the chunk within the type scope.',
'type' => 'int',
'not null' => TRUE,
'unsigned' => TRUE,
],
'status' => [
'description' => 'Flag indicating the publishing status of the chunk.',
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'unsigned' => TRUE,
'default' => 0,
],
],
];
$schema
->addIndex('simple_sitemap', 'type_status_delta', [
'type',
'status',
'delta',
], $spec);
$spec = [
'fields' => [
'type' => [
'description' => 'Type of sitemap this override belongs to.',
'type' => 'varchar',
'length' => 50,
'not null' => TRUE,
],
'entity_type' => [
'description' => 'Entity type of the overriding entity.',
'type' => 'varchar',
'length' => 32,
'not null' => TRUE,
],
'entity_id' => [
'description' => 'ID of the overriding entity.',
'type' => 'varchar',
'length' => 32,
'not null' => TRUE,
],
],
];
$schema
->addIndex('simple_sitemap_entity_overrides', 'entity_key', [
'type',
'entity_type',
'entity_id',
], $spec);
}