You are here

function notifications_widget_update_8102 in Notifications widget 8

Adding column entity user id.

File

./notifications_widget.install, line 215
Install, update and uninstall functions for the notification module module.

Code

function notifications_widget_update_8102() {
  $connection = \Drupal::database();
  $columnExists = $connection
    ->schema()
    ->fieldExists('notifications', 'entity_uid');
  if ($columnExists == '') {
    $spec = [
      'type' => 'int',
      'description' => 'Entity uid of action performed',
      'AFTER' => 'entity_id',
    ];
    $schema = Database::getConnection()
      ->schema();
    $schema
      ->addField('notifications', 'entity_uid', $spec);
  }
}