You are here

function og_update_8002 in Organic groups 8

Add uuid field to OgMembership.

File

./og.install, line 87

Code

function og_update_8002() {
  $manager = \Drupal::entityDefinitionUpdateManager();
  $entity_type = $manager
    ->getEntityType('og_membership');
  $entity_keys = $entity_type
    ->getKeys();
  $entity_keys['uuid'] = 'uuid';
  $entity_type
    ->set('entity_keys', $entity_keys);
  $manager
    ->updateEntityType($entity_type);
  $manager
    ->updateFieldStorageDefinition($manager
    ->getFieldStorageDefinition('uuid', 'og_membership'));
}