You are here

function menu_entity_index_update_8102 in Menu Entity Index 8

Updates parent_id field definition of menu_entity_index database table.

File

./menu_entity_index.install, line 172
Hooks related to (un-)installation of Menu Entity Index module.

Code

function menu_entity_index_update_8102() {
  $table = 'menu_entity_index';
  $field = 'parent_id';
  $spec = [
    'description' => 'The entity id of the parent entity.',
    'type' => 'varchar',
    'length' => 128,
    'not null' => FALSE,
  ];
  $schema = Database::getConnection()
    ->schema();
  if ($schema) {
    if ($schema
      ->tableExists($table)) {
      if ($schema
        ->fieldExists($table, $field)) {
        $schema
          ->changeField($table, $field, $field, $spec);
      }
    }
  }
}