How do I alter the node entity? Maintainer of Custom Publishing Options here... trying to figure out how to port to 8 in a clean way.

https://www.drupal.org/node/2647410

I have config entities working, so I can define custom publish options in the admin. 

From here, I would like to add these options on the Node form(s), but they also need to be stored in node_field_data table. Previously hook_schema_alter / entity_info_alter was used to do this, example below:

D7:

/**
 * Implements hook_schema_alter().
 */
function custom_pub_schema_alter(&amp;$schema) {
  $types = variable_get('custom_pub_types', array());
  foreach ($types as $type) {
    $schema['node']['fields'][$type['type']] = array(
      'description' =&gt; t('Custom publishing option @name', array('@name' =&gt; $type['name'])),
      'type' =&gt; 'int',
      'not null' =&gt; TRUE,
      'default' =&gt; 0,
    );
  }
}


D8:

function custom_pub_entity_base_field_info(EntityTypeInterface $entity_type) {
  if ($entity_type-&gt;id() === 'node') {
    $fields = [];

    foreach (Drupal::entityTypeManager()-&gt;getStorage('custom_publishing_option')-&gt;loadMultiple() as $machine_name =&gt; $publish_option) {
      $fields['cpo_' . $publish_option-&gt;id()] = BaseFieldDefinition::create('boolean')
        -&gt;setLabel(t('!label', ['!label' =&gt; $publish_option-&gt;label()]))
        -&gt;setDescription(t('A status added by custom publishing options.'))
        -&gt;setRevisionable(TRUE)
        -&gt;setTranslatable(TRUE)
        -&gt;setDefaultValue(FALSE)
        -&gt;setDisplayConfigurable('form', TRUE);
    }

    return $fields;
  }
}


$fields looks good here, and no errors are thrown - yet, I do not see any change to the data in the database. I would expect fields to be added to the node_field_data table, what is missing here? hook_schema_alter() has been removed, is there a way to trigger this to update that I don't see?

The purpose of this module is to let admins define their own statuses to use with the default node statuses, which from there they can combine them for different Views/Rules/Action capabilities. Being set on the node similar to status/promote/sticky made it fairly quick.
When entities are created, I had to do this to create them in the node table:

$manager = \Drupal::entityDefinitionUpdateManager();

if ($is_new) {
      // create the field definition for the node
      $storage_definition = BaseFieldDefinition::create('boolean')
        -&gt;setLabel(t('!label', ['!label' =&gt; $label]))
        -&gt;setDescription(t('!description', ['!description' =&gt; $description]))
        -&gt;setRevisionable(TRUE)
        -&gt;setTranslatable(TRUE)
        -&gt;setDefaultValue(0)
        -&gt;setDisplayConfigurable('form', TRUE);

      $manager-&gt;installFieldStorageDefinition($id, 'node', 'custom_pub', $storage_definition);
    } else {
      $storage_definition = $manager-&gt;getFieldStorageDefinition($id, 'node');

      if (isset($storage_definition)) {
        // update the label and description on the definition
        $storage_definition
          -&gt;setLabel(t('!label', ['!label' =&gt; $label]))
          -&gt;setDescription(t('!description', ['!description' =&gt; $description]));

        $manager-&gt;updateFieldStorageDefinition($storage_definition);
      }
    }