You are here

function comment_update_8400 in Drupal 8

Update the status field.

File

core/modules/comment/comment.install, line 218
Install, update and uninstall functions for the Comment module.

Code

function comment_update_8400() {

  // The status field was promoted to an entity key in comment_update_8301(),
  // which makes it NOT NULL in the default SQL storage, which means its storage
  // definition needs to be updated as well.
  $entity_definition_update_manager = \Drupal::service('entity.definition_update_manager');
  $entity_definition_update_manager
    ->updateFieldStorageDefinition($entity_definition_update_manager
    ->getFieldStorageDefinition('status', 'comment'));
}