Skip to main content

Database backup missing table information "inventory_stock_1" #19542

Database backup missing table information "inventory_stock_1" 

 

The CREATE ALGORITHM statement requires elevated MySQL access.
It is likely that the server you are working on does not have this and will halt the import process.

This line needs to come out of the SQL being migrated.

Instead run the following to create the view

CREATE
OR REPLACE
VIEW `inventory_stock_1` AS select
    distinct `legacy_stock_status`.`product_id` AS `product_id`,
    `legacy_stock_status`.`website_id` AS `website_id`,
    `legacy_stock_status`.`stock_id` AS `stock_id`,
    `legacy_stock_status`.`qty` AS `quantity`,
    `legacy_stock_status`.`stock_status` AS `is_salable`,
    `product`.`sku` AS `sku`
from
    ( `cataloginventory_stock_status` `legacy_stock_status`
join `catalog_product_entity` `product` on
        (( `legacy_stock_status`.`product_id` = `product`.`entity_id` )));

 

Reference : 

https://github.com/magento/magento2/issues/19542#issuecomment-467197872

Tags