Add property to existing field type I have troubles adding a simple additional properties (like alt or title) to the image field type.

In the .module file I defined an alternative class for the image field.

function image_video_link_field_info_alter(&amp;$info) {
  // Change the default widget for fields of type 'image'.
  if (isset($info['image'])) {
    $info['image']['class'] = '\Drupal\image_video_link\LinkedImageItem';
    #$info['image']['column_groups']['videolink'] = ['label' =&gt; t('Link to a video.')];
  }
}


I extended the ImageItem class with some additional properties.

/**
 * @file
 * Contains \Drupal\image_video_link\LinkedImageItem.
 */

namespace Drupal\image_video_link;

use Drupal\image\Plugin\Field\FieldType\ImageItem;
use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\Core\Field\FieldStorageDefinitionInterface;
use Drupal\Core\TypedData\DataDefinition;

/**
 * Extends the default PathItem implementation to generate aliases.
 */
class LinkedImageItem extends ImageItem {
  /**
   * {@inheritdoc}
   */
  public static function defaultStorageSettings() {
    $settings = parent::defaultStorageSettings();
    $settings['default_image']['videolink'] = '';
    return $settings;
  }

  /**
   * {@inheritdoc}
   */
  public static function defaultFieldSettings() {
    $settings = parent::defaultFieldSettings();
    $settings['default_image']['videolink'] = '';
    return $settings;
  }

  /**
   * {@inheritdoc}
   */
  public static function schema(FieldStorageDefinitionInterface $field_definition) {
    $schema = parent::schema($field_definition);
    $schema['columns']['videolink'] = [
      'description' =&gt; "Link to a video.",
      'type' =&gt; 'varchar',
      'length' =&gt; 512,
    ];
    return $schema;
  }

  /**
   * {@inheritdoc}
   */
  public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
    $properties = parent::propertyDefinitions($field_definition);

    $properties['videolink'] = DataDefinition::create('string')
      -&gt;setLabel(t('Videolink'))
      -&gt;setDescription(t("Link to a video on Vimeo."));

    return $properties;
  }
}


I believe I have to update the database in the .install file as I am getting the following error. 


  Undefined property: stdClass::$field_gallery_videolink


How do I do that? Is my method even valid?
I know this is a older issue but I found it when trying to do the same. Still for this exactly case maybe answer from xxx would be also helpful.

After it took me a while to figure out how to do it I wanted to share this example. Only thing needs to change is the first few lines.

/**
 * Add new property to all fields of type XXX.
 */
function XXX_update_80YY() {
  $field_type = 'XXX';
  $new_properties = array(
    'PROPERTY_NAME' =&gt; array(
      'description' =&gt; 'PROPERTY DESCRIPTION',
      'type' =&gt; 'varchar',
      'length' =&gt; 255,
    ),
  );

  $definition_update_manager = \Drupal::entityDefinitionUpdateManager();
  /** @var \Drupal\Core\Entity\EntityFieldManagerInterface $field_manager */
  $field_manager = \Drupal::service('entity_field.manager');
  /** @var \Drupal\Core\Entity\EntityTypeManager $entity_type_manager */
  $entity_type_manager = \Drupal::service('entity_type.manager');
  $field_map = $field_manager-&gt;getFieldMapByFieldType($field_type);
  $schema = Database::getConnection()-&gt;schema();
  foreach ($field_map as $entity_type_id =&gt; $fields) {
    $field_manager-&gt;clearCachedFieldDefinitions();
    $storage_definitions = $field_manager-&gt;getFieldStorageDefinitions($entity_type_id);

    $storage = $entity_type_manager-&gt;getStorage($entity_type_id);
    /** @var \Drupal\Core\Entity\Sql\DefaultTableMapping $table_mapping */
    $table_mapping = $storage-&gt;getTableMapping();

    foreach ($fields as $field_name =&gt; $field) {
      $storage_definition = $storage_definitions[$field_name];
      if (!empty($storage_definition)) {
        $column_names = $table_mapping-&gt;getColumnNames($field_name);
        $table_names = [ $table_mapping-&gt;getFieldTableName($field_name) ];

        if ($storage_definition-&gt;isRevisionable()) {
          $table_names[] = $table_mapping-&gt;getDedicatedRevisionTableName($storage_definition);
        }

        foreach ($table_names as $table_name) {
          foreach ($new_properties as $property_name =&gt; $property_spec) {
            if (!$schema-&gt;fieldExists($table_name, $column_names[$property_name])) {
              $schema-&gt;addField($table_name, $column_names[$property_name], $property_spec);
            }
          }
        }
        $definition_update_manager-&gt;updateFieldStorageDefinition($storage_definition);
      }
    }
  }
}