diff --git a/paragraphs.install b/paragraphs.install
index 32dbfd4..bc5ea55 100644
--- a/paragraphs.install
+++ b/paragraphs.install
@@ -5,6 +5,8 @@
  */
 
 use Drupal\Core\Field\BaseFieldDefinition;
+use Drupal\Core\Site\Settings;
+use Drupal\field\Entity\FieldStorageConfig;
 
 /**
  * Add status field.
@@ -17,3 +19,122 @@ function paragraphs_update_8001() {
   \Drupal::entityDefinitionUpdateManager()
     ->installFieldStorageDefinition('status', 'paragraph', 'paragraph', $storage_definition);
 }
+
+/**
+ * Add parent ID, parent type and parent field name fields.
+ */
+function paragraphs_update_8002() {
+  $storage_definition = BaseFieldDefinition::create('string')
+    ->setLabel(t('Parent ID'))
+    ->setDescription(t('The ID of the parent entity of which this entity is referenced.'));
+  \Drupal::entityDefinitionUpdateManager()
+    ->installFieldStorageDefinition('parent_id', 'paragraph', 'paragraph', $storage_definition);
+
+  $storage_definition = BaseFieldDefinition::create('string')
+    ->setLabel(t('Parent type'))
+    ->setDescription(t('The entity parent type to which this entity is referenced.'));
+  \Drupal::entityDefinitionUpdateManager()
+    ->installFieldStorageDefinition('parent_type', 'paragraph', 'paragraph', $storage_definition);
+
+  $storage_definition = BaseFieldDefinition::create('string')
+    ->setLabel(t('Parent field name'))
+    ->setDescription(t('The entity parent field name to which this entity is referenced.'));
+  \Drupal::entityDefinitionUpdateManager()
+    ->installFieldStorageDefinition('parent_field_name', 'paragraph', 'paragraph', $storage_definition);
+}
+
+/**
+ * Set the parent id, type and field name to the already created paragraphs.
+ *
+ * @param $sandbox
+ */
+function paragraphs_update_8003(&$sandbox) {
+  if (!isset($sandbox['current_err_field'])) {
+    $err_field_ids = [];
+    // Get all the entity reference revisions fields.
+    $map = \Drupal::service('entity_field.manager')->getFieldMapByFieldType('entity_reference_revisions');
+    foreach ($map as $type => $info) {
+      foreach ($info as $name => $data) {
+        if (FieldStorageConfig::load("$type.$name")->getSetting('target_type') == 'paragraph') {
+          $err_field_ids[] = "$type.$name";
+        }
+      }
+    }
+    // Initialize the sandbox.
+    $sandbox['current_err_field'] = 0;
+    $sandbox['list-ids'] = $err_field_ids;
+    $sandbox['max'] = count($err_field_ids);
+    $sandbox['progress'] = 0;
+  }
+
+  /** @var \Drupal\field\FieldStorageConfigInterface $field_storage */
+  $field_storage = FieldStorageConfig::load($sandbox['list-ids'][$sandbox['current_err_field']]);
+  if (\Drupal::entityManager()->getDefinition($field_storage->getTargetEntityTypeId())->isRevisionable()) {
+    // Check if the entity type is revisionable.
+    $entity_ids = \Drupal::entityQuery($field_storage->getTargetEntityTypeId())
+      ->condition($field_storage->getName(), NULL, 'IS NOT NULL')
+      ->range($sandbox['progress'], Settings::get('paragraph_limit', 50))
+      ->allRevisions()
+      ->execute();
+  }
+  else {
+    $entity_ids = \Drupal::entityQuery($field_storage->getTargetEntityTypeId())
+      ->condition($field_storage->getName(), NULL, 'IS NOT NULL')
+      ->range($sandbox['progress'], Settings::get('paragraph_limit', 50))
+      ->execute();
+  }
+  foreach ($entity_ids as $revision_id => $entity_id) {
+    if (\Drupal::entityManager()->getDefinition($field_storage->getTargetEntityTypeId())->isRevisionable()) {
+      // If the entity type is revisionable then get the revision.
+      $host_entity = \Drupal::entityTypeManager()
+        ->getStorage($field_storage->getTargetEntityTypeId())
+        ->loadRevision($revision_id);
+    }
+    else {
+      // If not then get the current load the entity.
+      $host_entity = \Drupal::entityTypeManager()
+        ->getStorage($field_storage->getTargetEntityTypeId())
+        ->load($entity_id);
+    }
+    foreach ($host_entity->get($field_storage->getName()) as $field_item) {
+      // Set the fields and save.
+      $field_item->entity->parent_type = $field_storage->getTargetEntityTypeId();
+      $field_item->entity->parent_id = $host_entity->id();
+      $field_item->entity->parent_field_name = $field_storage->getName();
+      $field_item->entity->setNewRevision(FALSE);
+      $field_item->entity->save();
+    }
+  }
+  if (count($entity_ids) < Settings::get('paragraph_limit', 50)) {
+    $sandbox['current_err_field']++;
+    $sandbox['progress'] = 0;
+  }
+  else {
+    $sandbox['progress'] += Settings::get('paragraph_limit', 50);
+  }
+  $sandbox['#finished'] = empty($sandbox['max']) ? 1 : ($sandbox['current_err_field'] / $sandbox['max']);
+}
+
+/**
+ * Delete the orphans.
+ */
+function paragraphs_update_8004(&$sandbox) {
+  if (!isset($sandbox['progress'])) {
+    $sandbox['progress'] = 0;
+    $sandbox['max'] = count(\Drupal::entityQuery('paragraph')
+      ->condition('parent_type', NULL, 'IS NULL')
+      ->execute());
+  }
+  // Limitation: Deletes all paragraph entities that are in use in a previous
+  // host entity revision without default ones.
+  $ids = \Drupal::entityQuery('paragraph')
+    ->condition('parent_type', NULL, 'IS NULL')
+    ->range($sandbox['progress'], Settings::get('paragraph_limit', 50))
+    ->execute();
+
+  foreach (\Drupal::entityTypeManager()->getStorage('paragraph')->loadMultiple($ids) as $entity) {
+    $entity->delete();
+    $sandbox['progress']++;
+  }
+  $sandbox['#finished'] = empty($sandbox['max']) ? 1 : ($sandbox['progress'] / $sandbox['max']);
+}
diff --git a/src/Entity/Paragraph.php b/src/Entity/Paragraph.php
index 6773fb3..56b3e4a 100644
--- a/src/Entity/Paragraph.php
+++ b/src/Entity/Paragraph.php
@@ -40,6 +40,9 @@ use Drupal\user\UserInterface;
  *   revision_table = "paragraphs_item_revision",
  *   revision_data_table = "paragraphs_item_revision_field_data",
  *   translatable = TRUE,
+ *   entity_revision_parent_type_field = "parent_type",
+ *   entity_revision_parent_id_field = "parent_id",
+ *   entity_revision_parent_field_name_field = "parent_field_name",
  *   entity_keys = {
  *     "id" = "id",
  *     "uuid" = "uuid",
@@ -79,6 +82,16 @@ class Paragraph extends ContentEntityBase implements ParagraphInterface {
   /**
    * {@inheritdoc}
    */
+  public function getParentEntity() {
+    if (!isset($this->get('parent_type')->value) || !isset($this->get('parent_id')->value)) {
+      return NULL;
+    }
+    return \Drupal::entityManager()->getStorage($this->get('parent_type')->value)->load($this->get('parent_id')->value);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
   public function preSave(EntityStorageInterface $storage) {
     parent::preSave($storage);
 
@@ -297,6 +310,18 @@ class Paragraph extends ContentEntityBase implements ParagraphInterface {
       ->setQueryable(FALSE)
       ->setRevisionable(TRUE);
 
+    $fields['parent_id'] = BaseFieldDefinition::create('string')
+      ->setLabel(t('Parent ID'))
+      ->setDescription(t('The ID of the parent entity of which this entity is referenced.'));
+
+    $fields['parent_type'] = BaseFieldDefinition::create('string')
+      ->setLabel(t('Parent type'))
+      ->setDescription(t('The entity parent type to which this entity is referenced.'));
+
+    $fields['parent_field_name'] = BaseFieldDefinition::create('string')
+      ->setLabel(t('Parent field name'))
+      ->setDescription(t('The entity parent field name to which this entity is referenced.'));
+
     return $fields;
   }
 
diff --git a/src/ParagraphAccessControlHandler.php b/src/ParagraphAccessControlHandler.php
index c4eb862..28d7283 100644
--- a/src/ParagraphAccessControlHandler.php
+++ b/src/ParagraphAccessControlHandler.php
@@ -22,9 +22,15 @@ class ParagraphAccessControlHandler extends EntityAccessControlHandler {
   /**
    * {@inheritdoc}
    */
-  protected function checkAccess(EntityInterface $entity, $operation, AccountInterface $account) {
+  protected function checkAccess(EntityInterface $paragraph, $operation, AccountInterface $account) {
     // Allowed when the operation is not view or the status is true.
-    return AccessResult::allowedIf($operation != 'view' || $entity->status->value);
+    /** @var \Drupal\paragraphs\Entity\Paragraph $paragraph */
+    if (!$paragraph->isNew() && $paragraph->getParentEntity() != NULL) {
+      $parent_access = $paragraph->getParentEntity()->access($operation, $account, TRUE);
+      return AccessResult::allowedIf($operation != 'view' || $paragraph->status->value)
+        ->andIf($parent_access);
+    }
+    return AccessResult::allowedIf($operation != 'view' || $paragraph->status->value);
   }
 
   /**
diff --git a/src/ParagraphInterface.php b/src/ParagraphInterface.php
index e9bf06b..c5f80a6 100644
--- a/src/ParagraphInterface.php
+++ b/src/ParagraphInterface.php
@@ -13,10 +13,14 @@ use Drupal\Core\Entity\ContentEntityInterface;
 
 /**
  * Provides an interface defining a paragraphs entity.
- * @ingroup account
+ * @ingroup paragraphs
  */
 interface ParagraphInterface extends ContentEntityInterface, EntityChangedInterface, EntityOwnerInterface
 {
 
-  // Add get/set methods for your configuration properties here.
+  /**
+   * Gets the parent entity of the paragraph.
+   *
+   */
+  public function getParentEntity();
 }
diff --git a/src/ParagraphStorageSchema.php b/src/ParagraphStorageSchema.php
index 405106e..12e2360 100644
--- a/src/ParagraphStorageSchema.php
+++ b/src/ParagraphStorageSchema.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\paragraphs;
 
+use Drupal\Core\Entity\ContentEntityTypeInterface;
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
 use Drupal\file\FileStorageSchema;
 
@@ -14,6 +15,20 @@ use Drupal\file\FileStorageSchema;
  * Extends the paragraphs schema handler.
  */
 class ParagraphStorageSchema extends FileStorageSchema {
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function getEntitySchema(ContentEntityTypeInterface $entity_type, $reset = FALSE) {
+    $schema = parent::getEntitySchema($entity_type, $reset);
+
+    $schema['paragraphs_item_field_data']['indexes'] += array(
+      'paragraphs__parent_fields' => array('parent_type', 'parent_id', 'parent_field_name'),
+    );
+
+    return $schema;
+  }
+
   /**
    * {@inheritdoc}
    */
diff --git a/src/Tests/ParagraphsAccessTest.php b/src/Tests/ParagraphsAccessTest.php
new file mode 100644
index 0000000..aec7724
--- /dev/null
+++ b/src/Tests/ParagraphsAccessTest.php
@@ -0,0 +1,134 @@
+<?php
+/**
+ * @file
+ * Contains \Drupal\paragraphs\ParagraphsAccessTest.
+ */
+
+namespace Drupal\paragraphs\Tests;
+
+use Drupal\Core\Entity\Entity;
+use Drupal\field_ui\Tests\FieldUiTestTrait;
+use Drupal\simpletest\WebTestBase;
+use Drupal\user\RoleInterface;
+use Drupal\user\Entity\Role;
+
+/**
+ * Tests the access check of paragraphs.
+ *
+ * @group paragraphs
+ */
+class ParagraphsAccessTest extends WebTestBase {
+
+  use FieldUiTestTrait;
+
+  /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  public static $modules = array(
+    'node',
+    'paragraphs',
+    'field',
+    'image',
+    'field_ui',
+    'block',
+    'paragraphs_demo',
+  );
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp() {
+    parent::setUp();
+    $this->drupalPlaceBlock('local_tasks_block');
+    $this->drupalPlaceBlock('page_title_block');
+  }
+
+  /**
+   * Tests the paragraph translation.
+   */
+  public function testParagraphAccessCheck() {
+    $admin_user = $this->drupalCreateUser(array(
+      'administer site configuration',
+      'administer nodes',
+      'administer content types',
+      'administer node fields',
+      'administer node display',
+      'administer paragraphs types',
+      'administer paragraph fields',
+      'administer paragraph display',
+      'administer paragraph form display',
+      'administer node form display',
+      'create paragraphed_content_demo content',
+      'edit any paragraphed_content_demo content',
+      'delete any paragraphed_content_demo content',
+    ));
+    $this->drupalLogin($admin_user);
+
+    $this->drupalLogin($admin_user);
+
+    // Remove the "access content" for anonymous users. That results in
+    // anonymous users not being able to "view" the host entity.
+    /* @var Role $role */
+    $role = \Drupal::entityManager()
+      ->getStorage('user_role')
+      ->load(RoleInterface::ANONYMOUS_ID);
+    $role->revokePermission('access content');
+    $role->save();
+
+    // Set field_images from demo to private file storage.
+    $edit = array(
+      'settings[uri_scheme]' => 'private',
+    );
+    $this->drupalPostForm('admin/structure/paragraphs_type/images/fields/paragraph.images.field_images_demo/storage', $edit, t('Save field settings'));
+
+    // Create a new demo node.
+    $this->drupalGet('node/add/paragraphed_content_demo');
+
+    // Add a new paragraphs images item.
+    $this->drupalPostForm(NULL, NULL, t('Add Images'));
+
+    // Create a file, upload it.
+    $text = 'Trust me I\'m an image';
+    file_put_contents('temporary://privateImage.jpg', $text);
+    $file_path = $this->container->get('file_system')
+      ->realpath('temporary://privateImage.jpg');
+
+    $edit = array(
+      'title[0][value]' => 'Security test node',
+      'files[field_paragraphs_demo_0_subform_field_images_demo_0][]' => $file_path,
+    );
+    $image_url = file_create_url('private://privateImage.jpg');
+    $this->drupalPostForm(NULL, $edit, t('Preview'));
+    $this->assertRaw($image_url, 'Image was found in preview');
+    $this->clickLink(t('Back to content editing'));
+    $edit = [
+      'field_paragraphs_demo[0][subform][field_images_demo][0][width]' => 100,
+      'field_paragraphs_demo[0][subform][field_images_demo][0][height]' => 100,
+    ];
+    $this->drupalPostForm(NULL, $edit, 'Save and publish');
+
+    $node = $this->drupalGetNodeByTitle('Security test node');
+
+    $this->drupalGet('node/' . $node->id());
+
+    // Check the text and image after publish.
+    $this->assertRaw($image_url, 'Image was found in content');
+
+    $this->drupalGet($image_url);
+    $this->assertResponse(200, 'Image could be downloaded');
+
+    // Logout to become anonymous.
+    $this->drupalLogout();
+
+    // Check the text and image after publish.
+    // Anonymous should not see content.
+    $this->assertNoRaw($image_url, 'Image was not found in content');
+
+    debug($image_url);
+    $this->drupalGet($image_url);
+    debug($this->getRawContent());
+    $this->assertResponse(403, 'Image could not be downloaded');
+  }
+}
diff --git a/src/Tests/ParagraphsCompositeRelationshipTest.php b/src/Tests/ParagraphsCompositeRelationshipTest.php
new file mode 100644
index 0000000..3f1ef45
--- /dev/null
+++ b/src/Tests/ParagraphsCompositeRelationshipTest.php
@@ -0,0 +1,225 @@
+<?php
+/**
+ * @file
+ * Contains \Drupal\paragraphs\Tests\ParagraphsCompositeRelationshipTest.
+ */
+
+namespace Drupal\paragraphs\Tests;
+
+use Drupal\Core\Entity\Entity;
+use Drupal\field\Entity\FieldConfig;
+use Drupal\field\Entity\FieldStorageConfig;
+use Drupal\field_ui\Tests\FieldUiTestTrait;
+use Drupal\node\Entity\Node;
+use Drupal\paragraphs\Entity\Paragraph;
+use Drupal\paragraphs\Entity\ParagraphsType;
+use Drupal\simpletest\WebTestBase;
+use Drupal\user\Entity\User;
+
+/**
+ * Tests the ERR composite relationship on paragraphs.
+ *
+ * @group paragraphs
+ */
+class ParagraphsCompositeRelationshipTest extends WebTestBase {
+
+  use FieldUiTestTrait;
+
+  /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  public static $modules = array(
+    'paragraphs',
+    'node',
+  );
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp() {
+    parent::setUp();
+    // Create paragraphs and article content types.
+    $this->drupalCreateContentType(array('type' => 'article', 'name' => 'Article'));
+  }
+
+  /**
+   * Tests the revision of paragraphs.
+   */
+  public function testParagraphsRevisions() {
+    // Create the paragraph type.
+    $paragraph_type = ParagraphsType::create(array(
+      'label' => 'test_text',
+      'id' => 'test_text',
+    ));
+    $paragraph_type->save();
+
+    // Add a paragraph field to the article.
+    $field_storage = FieldStorageConfig::create(array(
+      'field_name' => 'node_paragraph_field',
+      'entity_type' => 'node',
+      'type' => 'entity_reference_revisions',
+      'cardinality' => '-1',
+      'settings' => array(
+        'target_type' => 'paragraph'
+      ),
+    ));
+    $field_storage->save();
+    $field = FieldConfig::create(array(
+      'field_storage' => $field_storage,
+      'bundle' => 'article',
+    ));
+    $field->save();
+
+    // Add a paragraph field to the user.
+    $field_storage = FieldStorageConfig::create(array(
+      'field_name' => 'user_paragraph_field',
+      'entity_type' => 'user',
+      'type' => 'entity_reference_revisions',
+      'settings' => array(
+        'target_type' => 'paragraph'
+      ),
+    ));
+    $field_storage->save();
+    $field = FieldConfig::create(array(
+      'field_storage' => $field_storage,
+      'bundle' => 'user',
+    ));
+    $field->save();
+
+    // Create a paragraph.
+    $paragraph1 = Paragraph::create([
+      'title' => 'Paragraph',
+      'type' => 'test_text',
+    ]);
+    $paragraph1->save();
+    // Create another paragraph.
+    $paragraph2 = Paragraph::create([
+      'title' => 'Paragraph',
+      'type' => 'test_text',
+    ]);
+    $paragraph2->save();
+    // Create another paragraph.
+    $paragraph_user_1 = Paragraph::create([
+      'title' => 'Paragraph',
+      'type' => 'test_text',
+    ]);
+    $paragraph_user_1->save();
+
+    // Create a node with two paragraphs.
+    $node = $this->createNode(array(
+      'title' => $this->randomMachineName(),
+      'type' => 'article',
+      'node_paragraph_field' => array($paragraph1, $paragraph2),
+      ));
+
+    // Create an user with a paragraph.
+    $user = User::create([
+      'name' => 'test',
+      'user_paragraph_field' => $paragraph_user_1,
+    ]);
+    $user->save();
+    $this->settingsSet('paragraph_limit', 1);
+    // Unset the parent field name, type and id of paragraph1.
+    /** @var \Drupal\paragraphs\Entity\Paragraph $paragraph */
+    $paragraph = Paragraph::load($paragraph1->id());
+    $paragraph->set('parent_field_name', NULL);
+    $paragraph->set('parent_type', NULL);
+    $paragraph->set('parent_id', NULL);
+    $paragraph->setNewRevision(FALSE);
+    $paragraph->save();
+
+    // Unset the parent field name, type and id of paragraph2.
+    $paragraph = Paragraph::load($paragraph2->id());
+    $paragraph->set('parent_field_name', NULL);
+    $paragraph->set('parent_type', NULL);
+    $paragraph->set('parent_id', NULL);
+    $paragraph->setNewRevision(FALSE);
+    $paragraph->save();
+
+    // Unset the parent field name, type and id of paragraph_user_1.
+    /** @var \Drupal\paragraphs\Entity\Paragraph $paragraph */
+    $paragraph = Paragraph::load($paragraph_user_1->id());
+    $paragraph->set('parent_field_name', NULL);
+    $paragraph->set('parent_type', NULL);
+    $paragraph->set('parent_id', NULL);
+    $paragraph->setNewRevision(FALSE);
+    $paragraph->save();
+
+    // Create a revision for node.
+    /** @var \Drupal\node\Entity\Node $node_revision1 */
+    $node_revision1 = Node::load($node->id());
+    /** @var \Drupal\paragraphs\Entity\Paragraph $paragraph1_revision1 */
+    $paragraph1_revision1 = Paragraph::load($paragraph1->id());
+    $paragraph1_revision1->setNewRevision(TRUE);
+    $paragraph1_revision1->save();
+    /** @var \Drupal\paragraphs\Entity\Paragraph $paragraph2_revision1 */
+    $paragraph2_revision1 = Paragraph::load($paragraph2->id());
+    $paragraph2_revision1->setNewRevision(TRUE);
+    $paragraph2_revision1->save();
+    $node_revision1->set('node_paragraph_field', [$paragraph1_revision1, $paragraph2_revision1]);
+    $node_revision1->setNewRevision(TRUE);
+    $node_revision1->save();
+
+    // Unset the parent field name, type and id of paragraph2_revision1.
+    $paragraph2_revision1 = Paragraph::load($paragraph2_revision1->id());
+    $paragraph2_revision1->set('parent_field_name', NULL);
+    $paragraph2_revision1->set('parent_type', NULL);
+    $paragraph2_revision1->set('parent_id', NULL);
+    $paragraph2_revision1->setNewRevision(FALSE);
+    $paragraph2_revision1->save();
+
+    // Create another revision for node.
+    /** @var \Drupal\node\Entity\Node $node_revision2 */
+    $node_revision2 = Node::load($node->id());
+    /** @var \Drupal\paragraphs\Entity\Paragraph $paragraph1_revision2 */
+    $paragraph1_revision2 = Paragraph::load($paragraph1->id());
+    $paragraph1_revision2->setNewRevision(TRUE);
+    $paragraph1_revision2->save();
+    $node_revision2->set('node_paragraph_field', [$paragraph1_revision2]);
+    $node_revision2->setNewRevision(TRUE);
+    $node_revision2->save();
+
+    // Run update function and check #finished.
+    $sandbox = [];
+    do {
+      paragraphs_update_8003($sandbox);
+    } while ($sandbox['#finished'] < 1);
+
+    $node_paragraph1 = Paragraph::load($paragraph1->id())->toArray();
+    // Check if the fields are properly set.
+    $this->assertEqual($node_paragraph1['parent_id'][0]['value'], $node->id());
+    $this->assertEqual($node_paragraph1['parent_type'][0]['value'], $node->getEntityTypeId());
+    $this->assertEqual($node_paragraph1['parent_field_name'][0]['value'], 'node_paragraph_field');
+
+    $node_paragraph2 = Paragraph::load($paragraph2->id())->toArray();
+    // Check if the fields are properly set.
+    $this->assertEqual($node_paragraph2['parent_id'][0]['value'], $node->id());
+    $this->assertEqual($node_paragraph2['parent_type'][0]['value'], $node->getEntityTypeId());
+    $this->assertEqual($node_paragraph2['parent_field_name'][0]['value'], 'node_paragraph_field');
+
+    $user_paragraph = Paragraph::load($paragraph_user_1->id())->toArray();
+    // Check if the fields are properly set.
+    $this->assertEqual($user_paragraph['parent_id'][0]['value'], $user->id());
+    $this->assertEqual($user_paragraph['parent_type'][0]['value'], $user->getEntityTypeId());
+    $this->assertEqual($user_paragraph['parent_field_name'][0]['value'], 'user_paragraph_field');
+
+    // Unset the parent field name, type and id of paragraph2.
+    /** @var \Drupal\paragraphs\Entity\Paragraph $paragraph */
+    $paragraph = Paragraph::load($paragraph2->id());
+    $paragraph->set('parent_field_name', NULL);
+    $paragraph->set('parent_type', NULL);
+    $paragraph->set('parent_id', NULL);
+    $paragraph->setNewRevision(FALSE);
+    $paragraph->save();
+
+    // Run update function.
+    $sandbox = [];
+    do {
+      paragraphs_update_8004($sandbox);
+    } while ($sandbox['#finished'] < 1);
+    // The paragraphs should be deleted.
+    $this->assertNull(Paragraph::load($paragraph2->id()));
+  }
+}
