You are here

function commerce_order_update_8201 in Commerce Core 8.2

Add the 'data' field to 'commerce_order_item' entities.

File

modules/order/commerce_order.install, line 43
Install, update and uninstall functions for the Order module.

Code

function commerce_order_update_8201() {
  $storage_definition = BaseFieldDefinition::create('map')
    ->setLabel(t('Data'))
    ->setDescription(t('A serialized array of additional data.'));
  $update_manager = \Drupal::entityDefinitionUpdateManager();
  $update_manager
    ->installFieldStorageDefinition('data', 'commerce_order_item', 'commerce_order', $storage_definition);
}