Updating custom entity field

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

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


Updated May 09, 2017 10:07 AM

Updated March 26, 2015 07:24 AM

Updated April 07, 2015 03:03 AM

Updated June 14, 2015 01:03 AM

Updated July 14, 2015 15:03 PM