You are here

function filefield_paths_update_8001 in File (Field) Paths 8

Add 'origname' field to 'file' entities.

File

./filefield_paths.install, line 25
Install, update and uninstall functions for the File (Field) Paths module.

Code

function filefield_paths_update_8001() {
  $storage_definition = BaseFieldDefinition::create('string')
    ->setLabel(t('Original filename'))
    ->setDescription(t('Original name of the file with no path components.'));
  \Drupal::entityDefinitionUpdateManager()
    ->installFieldStorageDefinition('origname', 'file', 'filefield_paths', $storage_definition);
}