You are here

function nodeviewcount_update_8102 in Node view count 8

Create separate indexes for nid and uid in database.

File

./nodeviewcount.install, line 79
Install, update and uninstall functions for the nodeviewcount module.

Code

function nodeviewcount_update_8102() {
  $table = 'nodeviewcount';
  $spec = nodeviewcount_schema()[$table];
  $schema = Database::getConnection()
    ->schema();
  $schema
    ->dropIndex($table, 'nid_uid');
  $schema
    ->addIndex($table, 'nid', [
    'nid',
  ], $spec);
  $schema
    ->addIndex($table, 'uid', [
    'uid',
  ], $spec);
}