You are here

function cms_content_sync_update_8009 in CMS Content Sync 8

Same name and namespace in other branches
  1. 2.1.x cms_content_sync.install \cms_content_sync_update_8009()
  2. 2.0.x cms_content_sync.install \cms_content_sync_update_8009()

Add index for status entities on entity_type and entity_uuid.

File

./cms_content_sync.install, line 408
Install file for cms_content_sync.

Code

function cms_content_sync_update_8009() {
  $spec = [
    "fields" => [
      "entity_type" => [
        "type" => "varchar",
        "length" => 255,
        "not null" => TRUE,
      ],
      "entity_uuid" => [
        "type" => "varchar",
        "length" => 32,
        "not null" => TRUE,
      ],
    ],
  ];
  $fields = [
    "entity_type",
    "entity_uuid",
  ];
  $schema = Drupal::database()
    ->schema();
  $schema
    ->addIndex("cms_content_sync_entity_status", "cms_content_sync__type_uuid", $fields, $spec);
  return 'Added index to entity status table to improve performance.';
}