Let's say you just generated a content entity with drush:
drush generate entity:content
(... you go through the prompts, and the entity is created in an existing, enabled module)
In the module's .install
file, add a hook_update_N()
, for example if you previously called your entity a_super_cool_entity
/**
* Install new entity type called a_super_cool_entity
*/
function backstopjs_tools_update_8001() {
// Install the new a_super_cool_entity entity type.
$update_manager = \Drupal::entityDefinitionUpdateManager();
$update_manager->installEntityType(\Drupal::entityTypeManager()->getDefinition('a_super_cool_entity'));
}
And run drush updb