Updating custom entity field

by jons   Last Updated July 11, 2019 21:07 PM - source

I have a custom entity and wish to increase size of a varchar field. This gives helpful input: https://www.drupal.org/docs/8/api/update-api/updating-database-schema-andor-data-in-drupal-8

I added the relevant 'Altering the length of a field with data' code to my .install, and updated my entity definition, and while the DB field is changed correctly, the Drupal Status report page still says 'Mismatched entity and/or field definitions'.

Running drush updatedb --entity-updates says it wont as field has data 'The SQL storage cannot change the schema for an existing field (yeargroup in compresult entity) with data.' (the whole point of the code in the ref)

Is there any way to persuade Drupal to not complain, ie so that the configs are aligned internally.

Tags : 8 entities


Related Questions




How to create a custom template for entities?

Updated April 07, 2015 03:03 AM


Drupal 8 Custom Entities from a UI?

Updated July 14, 2015 15:03 PM