You are here

function entity_usage_update_8201 in Entity Usage 8.4

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

Recreate the entity usage table with the new schema.

File

./entity_usage.install, line 130
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']);
}