You are here

function data_policy_update_8005 in Data Policy 8

Make the 'Name' field form data policy required.

File

./data_policy.install, line 143
Install, update and uninstall functions for the data_policy module.

Code

function data_policy_update_8005() {

  // Update definitions and schema.
  $manager = \Drupal::entityDefinitionUpdateManager();
  $storage_definition = $manager
    ->getFieldStorageDefinition('name', 'data_policy');
  $storage_definition
    ->setRequired(TRUE);
  $manager
    ->updateFieldStorageDefinition($storage_definition);
}