0

I am working with a Magento 2 database that is missing the 3 wishlist tables.

wishlist
wishlist_item       
wishlist_item_option

Is there a mysql script I can run to create these tables?

Thanks

1 Answer 1

0

I've had same issue 2.3.5 after setting 'Magento_Wishlist' => 0, and setup:upgrade these tables got deleted.

CREATE TABLE wishlist ( wishlist_id int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Wishlist ID', customer_id int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Customer ID', shared smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Sharing flag (0 or 1)',
sharing_code varchar(32) DEFAULT NULL COMMENT 'Sharing encrypted code', updated_at timestamp NULL DEFAULT NULL COMMENT 'Last updated date', PRIMARY KEY (wishlist_id), UNIQUE KEY WISHLIST_CUSTOMER_ID (customer_id), KEY WISHLIST_SHARED (shared), CONSTRAINT WISHLIST_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID FOREIGN KEY (customer_id) REFERENCES customer_entity (entity_id) ON DELETE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='Wishlist main Table';

NEXT:

CREATE TABLE wishlist_item ( wishlist_item_id int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Wishlist item ID', wishlist_id int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Wishlist ID',
product_id int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Product ID', store_id smallint(5) unsigned DEFAULT NULL COMMENT 'Store ID', added_at timestamp NULL DEFAULT NULL COMMENT 'Add date and time', description text COMMENT 'Short description of wish list item', qty decimal(12,4) NOT NULL COMMENT 'Qty', PRIMARY KEY (wishlist_item_id), KEY WISHLIST_ITEM_WISHLIST_ID (wishlist_id), KEY WISHLIST_ITEM_PRODUCT_ID (product_id),
KEY WISHLIST_ITEM_STORE_ID (store_id), CONSTRAINT WISHLIST_ITEM_PRODUCT_ID_CATALOG_PRODUCT_ENTITY_ENTITY_ID FOREIGN KEY (product_id) REFERENCES catalog_product_entity (entity_id) ON DELETE CASCADE, CONSTRAINT WISHLIST_ITEM_STORE_ID_STORE_STORE_ID FOREIGN KEY (store_id) REFERENCES store (store_id) ON DELETE SET NULL, CONSTRAINT WISHLIST_ITEM_WISHLIST_ID_WISHLIST_WISHLIST_ID FOREIGN KEY (wishlist_id) REFERENCES wishlist (wishlist_id) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Wishlist items';

NEXT:

CREATE TABLE wishlist_item_option ( option_id int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Option ID', wishlist_item_id int(10) unsigned NOT NULL COMMENT 'Wishlist Item ID', product_id int(10) unsigned NOT NULL COMMENT 'Product ID', code varchar(255) NOT NULL COMMENT 'Code', value text COMMENT 'Value', PRIMARY KEY (option_id), KEY FK_A014B30B04B72DD0EAB3EECD779728D6 (wishlist_item_id), CONSTRAINT FK_A014B30B04B72DD0EAB3EECD779728D6 FOREIGN KEY (wishlist_item_id) REFERENCES wishlist_item (wishlist_item_id) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Wishlist Item Option Table';

Problem sorted!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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