How do I alter the node entity?
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);
      }
    }