You are here

function entity_usage_update_8001 in Entity Usage 8.3

Same name and namespace in other branches
  1. 8.4 entity_usage.install \entity_usage_update_8001()
  2. 8 entity_usage.install \entity_usage_update_8001()
  3. 8.2 entity_usage.install \entity_usage_update_8001()

Include "method" also as primary key for the {entity_usage} table.

File

./entity_usage.install, line 150
Install, update and uninstall functions for entity_usage module.

Code

function entity_usage_update_8001(&$sandbox) {
  $database = \Drupal::database();
  $database
    ->schema()
    ->dropPrimaryKey('entity_usage');
  $new_primary_keys = [
    't_id',
    't_type',
    're_id',
    're_type',
    'method',
  ];
  $database
    ->schema()
    ->addPrimaryKey('entity_usage', $new_primary_keys);
}