updateFieldStorageDefinition() // with the new definition. $storage_definition = BaseFieldDefinition::create('boolean') ->setLabel(t('Revision translation affected')) ->setDescription(t('Indicates if the last edit of a translation belongs to current revision.')) ->setReadOnly(TRUE) ->setRevisionable(TRUE) ->setTranslatable(TRUE); \Drupal::entityDefinitionUpdateManager() ->installFieldStorageDefinition('revision_translation_affected', 'block_content', 'block_content', $storage_definition); } /** * Generalizes the d6_block_content_type and d6_block_content_body_field * migrations. */ function block_content_update_8002() { // Removed in issue #2569605. The Migrate and Migrate Drupal modules are // marked experimental and do not need to support the update path until they // are stable. // @see https://www.drupal.org/node/2569469 } /** * Add 'revision_created' and 'revision_user' fields to 'block_content' entities. */ function block_content_update_8003() { $revision_created = BaseFieldDefinition::create('created') ->setLabel(t('Revision create time')) ->setDescription(t('The time that the current revision was created.')) ->setRevisionable(TRUE); \Drupal::entityDefinitionUpdateManager() ->installFieldStorageDefinition('revision_created', 'block_content', 'block_content', $revision_created); $revision_user = BaseFieldDefinition::create('entity_reference') ->setLabel(t('Revision user')) ->setDescription(t('The user ID of the author of the current revision.')) ->setSetting('target_type', 'user') ->setRevisionable(TRUE); \Drupal::entityDefinitionUpdateManager() ->installFieldStorageDefinition('revision_user', 'block_content', 'block_content', $revision_user); } /** * Fix the block_content entity type to specify its revision data table. */ function block_content_update_8300() { $definition_update_manager = \Drupal::entityDefinitionUpdateManager(); $entity_type = $definition_update_manager->getEntityType('block_content'); $entity_type->set('revision_data_table', 'block_content_field_revision'); $definition_update_manager->updateEntityType($entity_type); }