function login_history_update_8001 in Login History 8
Adds the primary key field for existing tables.
File
- ./login_history.install, line 71 
- Install, update and uninstall functions for the Login History module.
Code
function login_history_update_8001() {
  $spec = login_history_schema();
  $field = $spec['login_history']['fields']['login_id'];
  $schema = Database::getConnection()
    ->schema();
  $schema
    ->addField('login_history', 'login_id', $field, [
    'primary key' => [
      'login_id',
    ],
  ]);
}