function entity_usage_update_8001 in Entity Usage 8.2
Same name and namespace in other branches
- 8.4 entity_usage.install \entity_usage_update_8001()
- 8 entity_usage.install \entity_usage_update_8001()
- 8.3 entity_usage.install \entity_usage_update_8001()
Include "method" also as primary key for the {entity_usage} table.
File
- ./
entity_usage.install, line 120 - 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);
}