You are here

function workspace_update_8109 in Workspace 8

Add the archive_source field.

File

./workspace.install, line 197
Install, update and uninstall functions for the workspace module.

Code

function workspace_update_8109() {
  $definition_update_manager = \Drupal::entityDefinitionUpdateManager();

  // Add the replication status field to the replication entity type.
  $archive_source = BaseFieldDefinition::create('boolean')
    ->setLabel(t('Archive source workspace flag'))
    ->setDescription(t('The flag that marks if the source workspace should be archived if replication ends with success.'))
    ->setRequired(FALSE)
    ->setDefaultValue(FALSE)
    ->setInitialValue(FALSE);
  $definition_update_manager
    ->installFieldStorageDefinition('archive_source', 'replication', 'workspace', $archive_source);
}