When installing the module with Drupal 8.7 I get the following error:

"Drupal\Core\Database\SchemaException: The 'entity_id' field specification does not define 'not null' as TRUE. in Drupal\Core\Database\Schema->ensureNotNullPrimaryKey() (line 734 of /srv/bindings/fb3a7421326d49c29f342ea868d533cd/code/web/core/lib/Drupal/Core/Database/Schema.php)."

It looks like this will eventually be fixed in core bug #2841291: Fix NOT NULL handling in the entity storage and 'primary key' changes when updating the storage definition of an identifier field, but in the meantime the following change fixes it, although I don't think it is the optimal way to solve the problem. The core issue says:

developers have to know about this limitation of entity API and override \Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema::getSharedTableFieldSchema() in order to mark fields as NOT NULL.

so that is probably the better way to solve the problem, but outside of my wheelhouse.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

BrightBold created an issue. See original summary.

BrightBold’s picture

krina.addweb’s picture

@BrightBold, Thanks for the patch. Your patch is working fine as it resolves the fatal error while installing the module. PFA

krina.addweb’s picture

Status: Needs review » Reviewed & tested by the community
Devendra Mishra’s picture

@BrightBold, Thank you for your patch.

Devendra Mishra’s picture

Assigned: Unassigned » Devendra Mishra
Status: Reviewed & tested by the community » Fixed

I have tested and then applied the patch in updated release 8.x-1.2. Thanks for helping @BrightBold & @krina.addweb.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.