public SqlContentEntityStorageSchema::requiresFieldDataMigration(FieldStorageDefinitionInterface $storage_definition, FieldStorageDefinitionInterface $original)
Checks if existing data would be lost if the schema changes were applied.
If there are no schema changes needed, then no data needs to be migrated, but it is not the responsibility of this function to recheck what requiresFieldStorageSchemaChanges() checks. Rather, the meaning of what this function returns when requiresFieldStorageSchemaChanges() returns FALSE is undefined. Callers are expected to only call this function when requiresFieldStorageSchemaChanges() is TRUE.
This function can return FALSE if any of these conditions apply:
When this function returns FALSE, site administrators will be unable to perform an automated update, and will instead need to perform a site migration or invoke some custom update process.
\Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition: The updated field storage definition.
\Drupal\Core\Field\FieldStorageDefinitionInterface $original: The original field storage definition.
bool TRUE if data migration is required, FALSE otherwise.
Overrides DynamicallyFieldableEntityStorageSchemaInterface::requiresFieldDataMigration
self::requiresFieldStorageSchemaChanges()
public function requiresFieldDataMigration(FieldStorageDefinitionInterface $storage_definition, FieldStorageDefinitionInterface $original) { return !$this->storage->countFieldData($original, TRUE); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!Sql!SqlContentEntityStorageSchema.php/function/SqlContentEntityStorageSchema::requiresFieldDataMigration/8.1.x