Commerce Upgrade and PDO Error - Field 'revision_id' doesn't have a default value

by Joel F.   Last Updated May 22, 2020 21:07 PM

A friend reached out to me to support their Drupal 7 store using the commerce module. Apparently the updates were made (the site hadn't been updated in awhile), and update.php WAS run (I asked), but w/ the latest version of the commerce code for 7.x (including 7.x-1.x-dev) they get this error:

General error: 1364 Field 'revision_id' doesn't have a default value: INSERT INTO {commerce_order_revision} (order_id, order_number, revision_uid, mail, status, log, revision_timestamp, revision_hostname, data) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8);

It looks like a DB update was skipped? If so, what is the proper way to fix this? This code is running on PHP 7.1 on a Linux cPanel server on a shared host. I did try setting a default, but that produced a duplicate PK error.

Any input would be appreciated.

Tags : commerce

Related Questions

Add multiple cart in drupal 7

Updated August 15, 2015 17:03 PM

Show a discount field in the Product display page

Updated March 29, 2015 06:02 AM