While running
1 |
php bin/magento indexer:reindex |
Above command getting below exception.
1 |
Exception #0 (Zend_Db_Statement_Exception): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'inventory_stock_1' doesn't exist, query was: INSERT INTO'search_tmp_5c4f24124efa61_76233970'SELECT'main_select'.'entity_id', SUM(score) AS'relevance'FROM (SELECT DISTINCT'search_index'.'entity_id', (((0) + (0)) * 1) AS'score'FROM'catalog_product_index_eav'AS'search_index' INNER JOIN 'catalog_product_entity' AS 'product' ON product.entity_id = search_index.entity_id INNER JOIN 'inventory_stock_1' AS 'stock_index' ON stock_index.sku = product.sku INNER JOIN 'catalog_category_product_index_store1' AS 'category_ids_index' ON search_index.entity_id = category_ids_index.product_id AND category_ids_index.store_id = '1' WHERE (search_index.store_id = '1') AND ('search_index'.'attribute_id' = 102 AND 'search_index'.'value' in ('2', '4') AND 'search_index'.'store_id' = '1') AND (category_ids_index.category_id = 394)) AS 'main_select' GROUP BY 'entity_id' ORDER BY 'relevance' DESC, 'entity_id' DESC LIMIT 10000 Exception #1 (PDOException): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'inventory_stock_1' doesn't exist |
To overcome the programmatical error, you need to create a view of the inventory_stock_1 table – We did some changes in the database.
Here is the command we ran in DB SQL.
1 |
CREATE ALGORITHM=UNDEFINED DEFINER=CURRENT_USER SQL SECURITY INVOKER 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`))) |
There you go. Now things will run smoothly. Hope it will work for everyone.
[crayon-63d976723ced1620990014/] Using above fucntion Images can be imported directly from...
Override view block using di.xml and add the below code...
You can check a list of called layout XML for...
Follow the below steps to install and set up PWA...
If you want to remove all leading zero's from order,...
Let our Magento expert connect to discuss your requirement.
We offer Magento
certified developers.
Our Magento clientele
is 500+.
We sign NDA for the
security of your projects.
We’ve performed 100+
Magento migration projects.
Free quotation
on your project.
Three months warranty on
code developed by us.