Created
December 4, 2019 17:19
-
-
Save cagartner/443511c55cf04718ff250e9bbc221115 to your computer and use it in GitHub Desktop.
Create inventory_stock_1 view for Magento 2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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` ))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment