When I try to update my database Schema I'm getting the following error:

Drupal\Core\Entity\Exception\FieldStorageDefinitionUpdateForbiddenException:[error] The SQL storage cannot change the schema for an existing field (order_total in uc_order entity) with data. in Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema->updateSharedTableSchema() (line 1376 of /www/htdocs/xxx/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php). Failed: [error] Drupal\Core\Entity\Exception\FieldStorageDefinitionUpdateForbiddenException: !message in Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema->updateSharedTableSchema() (line 1376 of /www/htdocs/xxx/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php).

What can I do?


Sounds like you are trying to update existing field order_total in uc_order. You can't update it since you have some data in it already. Remove content that uses it (orders), and try again.

Also note that drush entity:updates currently doesn't support all changes (e.g. changing table keys). See this Change Record for information on providing a hook_update(): https://www.drupal.org/node/2554097

| improve this answer | |
  • I checked if there is any orders and I couldn't find any... – Benedikt Sep 29 '16 at 17:35
  • I went to the database and deleted the entries there. – Benedikt Sep 29 '16 at 21:26

Have you been using ubercart for Drupal 8? There is a good chance give it's an alpha that there is no upgrade path. Using it in production at this stage could possibly cause issues when the schema for entities and tables change. Deleting the data on a production site might not always be an option.

If the data isn't relevant, a good way to "chase HEAD", that is follow the code when no upgrade path is available is to build sites as an install profile and regularly update your configuration objects as schema changes. Here is a blog post from a year or so before D8 was released which has some info about reinstalling to chase schema updates. More info on install profiles.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.