Add new field to custom content entity type I have created a custom content entity type called Course. When I installed my module, Drupal automatically created the table schema for my entity, so all the fields I defined in Course::baseFieldDefinitions() had their column in the database table course, as specified in the base_table annotation of my class.

Now I want to add an extra field to my entity. I edited the Course::baseFieldDefinitions() method to define my new field in the same way as I did with the previous ones. The problem is that I don't know how can I create the appropiate column in the database.

The relevant part of my Course entity is:
    

class Course extends ContentEntityBase implements CourseInterface {

  public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
    $fields = parent::baseFieldDefinitions($entity_type);

    $fields['user_id'] = BaseFieldDefinition::create('entity_reference');
      // Settings and constraints for this field

    $fields['name'] = BaseFieldDefinition::create('string');
      // Settings and constraints for this field

    $fields['price'] = BaseFieldDefinition::create("float");
      // Settings and constraints for this field

    $fields['status'] = BaseFieldDefinition::create('boolean');
      // Settings and constraints for this field

    $fields['created'] = BaseFieldDefinition::create('created');
      // Settings and constraints for this field

    $fields['changed'] = BaseFieldDefinition::create('changed');
      // Settings and constraints for this field

    // New field being added
    $fiels["place"] = BaseFieldDefinition::create("string")
      -&gt;setLabel(t("Place"))
      -&gt;setDescription(t("The place of the course"))
      -&gt;setSettings(["max_length" =&gt; 255, "text_processing" =&gt; 0])
      -&gt;setDefaultValue("")
      -&gt;setDisplayOptions("view", ["label" =&gt; "above", "type" =&gt; "string", "wegith" =&gt; -3])
      -&gt;setDisplayOptions("form", ["type" =&gt; "string_textfield", "wegith" =&gt; -3]);

    return $fields;
  }

}


I've tried using the Drupal console command update:entities but it is not updating my database schema.

How could I add the place field to my database table?
After installation, you need to handle updating the schema yourself. There are some different scenarios, some are more easy to deal with than others. The most complex is moving data from one field type to another which means you would have to do a migration of data.

Anyways Drupal core has the entityDefinitionUpdateManager() which can be accessed doing \Drupal::entityDefinitionUpdateManager(). This manager can do a lot of the things you need to do when you change the base fields of content entities.

Creation of a new field is pretty easy, and all you need to make your own update hook:

function hook_update_8xxx() {
  \Drupal::entityDefinitionUpdateManager()-&gt;applyUpdates();
}


This will apply all updates to all entities. This can generally be used for most things, but if there are data in Drupal has a failsafe that throws an exception to make sure it doesn't accidentally mess data up. During the beta the system attempted to handle data migration as well, but it didn't work well so it was decided that this is something module maintainers should do themselves.