You are here

function entity_usage_update_8201 in Entity Usage 8.3

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

Recreate the entity usage table with the new schema.

File

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

Code

function entity_usage_update_8201(&$sandbox) {
  $schema = \Drupal::database()
    ->schema();
  $schema
    ->dropTable('entity_usage');
  $new_table_schema = entity_usage_schema();
  $schema
    ->createTable('entity_usage', $new_table_schema['entity_usage']);
}