1.54 - 1.55f - Database Upgrade

I ran into this particular problem after clicking Confirm Order in the Checkout:

PHP Fatal error: 1062uplicate entry '0' for key 'PRIMARY' :: INSERT INTO zen_orders_products_download

The Error:
[08-Jan-2019 00:05:32 UTC] PHP Fatal error: 1062uplicate entry '0' for key 'PRIMARY' :: INSERT INTO zen_orders_products_download (orders_id, orders_products_id, orders_products_filename, download_maxdays, download_count, products_prid) VALUES ('2042', '2382', 'FileName', '7', '50', referenceID') ==> (as called by) /public_html/shop/includes/functions/functions_general.php on line 978 <== in /public_html/shop/includes/classes/db/mysql/query_factory.php on line 171


This happened because the tables did not have this code:

#
# Table structure for table 'orders_products_download'
#

DROP TABLE IF EXISTS orders_products_download;
CREATE TABLE orders_products_download (
orders_products_download_id int(11) NOT NULL auto_increment,
orders_id int(11) NOT NULL default '0',
orders_products_id int(11) NOT NULL default '0',
orders_products_filename varchar(255) NOT NULL default '',
download_maxdays int(2) NOT NULL default '0',
download_count int(2) NOT NULL default '0',
products_prid tinytext NOT NULL,
PRIMARY KEY (orders_products_download_id),
KEY idx_orders_id_zen (orders_id),
KEY idx_orders_products_id_zen (orders_products_id)
) ENGINE=MyISAM;

# --------------------------------------------------------


applied during the upgrade so they could not correctly see the indexes.

I will be testing the zc_install db upgrade scripts for any other missed actions and perhaps find out what caused the code to overlook the tables during the upgrade process.

After updating the database tables manually everything works as intended.