New Drupal Developer here.
I am currently working on a inventory management module for a friend. And I ran into a bit of a snag with Custom Entities in Drupal 8.
I have a custom "Customer" entity content type which stores various bits of information about the customer, first name, last name, a number which we assign each customer, etc...
When I added a new field post-module-install, after running update.php, cron, etc... The new field was never added to the existing SQL table.
I am wondering if there is something I'm missing, like a way to force update the database without having to manually add the new table.
Here is the new field I added.
$fields['l_number'] = BaseFieldDefinition::create('string')
->setLabel(t('L#'))
->setDescription(t('The Customer\'s L Number.'))
->setSettings(array(
'default_value' => '',
'max_length' => 8,
'text_processing' => 0,
))
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'string',
'weight' => -7,
))
->setDisplayOptions('form', array(
'type' => 'string',
'weight' => -7,
))
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);