0

I'm using Magento 2.2.5 Cloud commerce version and at success page I'm getting following error

2019-07-01T13:35:09+00:00 INFO (6): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'm2.amazon_sales_order' doesn't exist, query was: SELECT main_table.*, extension_attribute_amazon_order_reference_id.amazon_order_reference_id AS extension_attribute_amazon_order_reference_id_amazon_order_reference_id, extension_attribute_amazon_order_reference_id.order_id AS extension_attribute_amazon_order_reference_id_order_id FROM sales_order AS main_table LEFT JOIN amazon_sales_order AS extension_attribute_amazon_order_reference_id ON main_table.entity_id = extension_attribute_amazon_order_reference_id.order_id WHERE ((increment_id = '14000018349'))

I've checked database and amazon_sales_order isn't exist.

I can't update the Amazon module version nor Magento 2.

Does any have SQL Script to create this table? or any other solution?

0

Following is query to create amazon_sales_order

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
    SET time_zone = "+00:00";
    CREATE TABLE `amazon_sales_order` (
      `entity_id` int(10) UNSIGNED NOT NULL COMMENT 'Entity ID',
      `order_id` int(10) UNSIGNED NOT NULL COMMENT 'Order ID',
      `amazon_order_reference_id` varchar(255) NOT NULL COMMENT 'Amazon Order Reference ID'
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='amazon_sales_order';

    ALTER TABLE `amazon_sales_order`
      ADD PRIMARY KEY (`entity_id`),
      ADD UNIQUE KEY `AMAZON_SALES_ORDER_ORDER_ID` (`order_id`);
    ALTER TABLE `amazon_sales_order`
      MODIFY `entity_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Entity ID';
    ALTER TABLE `amazon_sales_order`
      ADD CONSTRAINT `AMAZON_SALES_ORDER_ORDER_ID_SALES_ORDER_ENTITY_ID` FOREIGN KEY (`order_id`) REFERENCES `sales_order` (`entity_id`) ON DELETE CASCADE;

Following is query to create amazon_quote

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
CREATE TABLE `amazon_quote` (
  `entity_id` int(10) UNSIGNED NOT NULL COMMENT 'Entity ID',
  `quote_id` int(10) UNSIGNED NOT NULL COMMENT 'Quote ID',
  `amazon_order_reference_id` varchar(255) NOT NULL COMMENT 'Amazon Order Reference ID',
  `sandbox_simulation_reference` varchar(255) DEFAULT NULL COMMENT 'Sandbox simulation reference',
  `confirmed` smallint(5) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'Quote confirmed with Amazon'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='amazon_quote';
ALTER TABLE `amazon_quote`
  ADD PRIMARY KEY (`entity_id`),
  ADD UNIQUE KEY `AMAZON_QUOTE_QUOTE_ID` (`quote_id`);
ALTER TABLE `amazon_quote`
  MODIFY `entity_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Entity ID';
ALTER TABLE `amazon_quote`
  ADD CONSTRAINT `AMAZON_QUOTE_QUOTE_ID_QUOTE_ENTITY_ID` FOREIGN KEY (`quote_id`) REFERENCES `quote` (`entity_id`) ON DELETE CASCADE;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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