-- Table structure for table `[[dbprefix]]payment_services_order_data_production_submitted_hash`
--

CREATE TABLE `[[dbprefix]]payment_services_order_data_production_submitted_hash` (
  `identifier` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Order identifier',
  `feed_hash` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'feed_hash',
  `submitted_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Submitted At',
  PRIMARY KEY (`identifier`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Payment Services Order Feed Storage';

--
-- Dumping data for table `[[dbprefix]]payment_services_order_data_production_submitted_hash`
--


--
-- Table structure for table `[[dbprefix]]payment_services_order_data_sandbox_submitted_hash`
--

CREATE TABLE `[[dbprefix]]payment_services_order_data_sandbox_submitted_hash` (
  `identifier` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Order identifier',
  `feed_hash` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'feed_hash',
  `submitted_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Submitted At',
  PRIMARY KEY (`identifier`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Payment Services Order Feed Storage';

--
-- Dumping data for table `[[dbprefix]]payment_services_order_data_sandbox_submitted_hash`
--


--
-- Table structure for table `[[dbprefix]]payment_services_order_status_data_prod_submitted_hash`
--

CREATE TABLE `[[dbprefix]]payment_services_order_status_data_prod_submitted_hash` (
  `identifier` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Order Status identifier',
  `feed_hash` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'feed_hash',
  `submitted_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Submitted At',
  PRIMARY KEY (`identifier`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Payment Services Order Status Feed Storage';

--
-- Dumping data for table `[[dbprefix]]payment_services_order_status_data_prod_submitted_hash`
--


--
-- Table structure for table `[[dbprefix]]payment_services_order_status_data_sandbox_submitted_hash`
--

CREATE TABLE `[[dbprefix]]payment_services_order_status_data_sandbox_submitted_hash` (
  `identifier` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Order Status identifier',
  `feed_hash` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'feed_hash',
  `submitted_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Submitted At',
  PRIMARY KEY (`identifier`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Payment Services Order Status Feed Storage';

--
-- Dumping data for table `[[dbprefix]]payment_services_order_status_data_sandbox_submitted_hash`
--


--
-- Table structure for table `[[dbprefix]]payment_services_store_data_production_submitted_hash`
--

CREATE TABLE `[[dbprefix]]payment_services_store_data_production_submitted_hash` (
  `identifier` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Store identifier',
  `feed_hash` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'feed_hash',
  `submitted_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Submitted At',
  PRIMARY KEY (`identifier`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Payment Services Store Feed Storage';

--
-- Dumping data for table `[[dbprefix]]payment_services_store_data_production_submitted_hash`
--


--
-- Table structure for table `[[dbprefix]]payment_services_store_data_sandbox_submitted_hash`
--

CREATE TABLE `[[dbprefix]]payment_services_store_data_sandbox_submitted_hash` (
  `identifier` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Store identifier',
  `feed_hash` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'feed_hash',
  `submitted_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Submitted At',
  PRIMARY KEY (`identifier`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Payment Services Store Feed Storage';

--
-- Dumping data for table `[[dbprefix]]payment_services_store_data_sandbox_submitted_hash`
--


--
-- Table structure for table `[[dbprefix]]paypal_billing_agreement`
--

CREATE TABLE `[[dbprefix]]paypal_billing_agreement` (
  `agreement_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Agreement ID',
  `customer_id` int unsigned NOT NULL COMMENT 'Customer ID',
  `method_code` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Method Code',
  `reference_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Reference ID',
  `status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Status',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Created At',
  `updated_at` timestamp NULL DEFAULT NULL COMMENT 'Updated At',
  `store_id` smallint unsigned DEFAULT NULL COMMENT 'Store ID',
  `agreement_label` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Agreement Label',
  PRIMARY KEY (`agreement_id`),
  KEY `[[DBPREFIX]]PAYPAL_BILLING_AGREEMENT_CUSTOMER_ID` (`customer_id`),
  KEY `[[DBPREFIX]]PAYPAL_BILLING_AGREEMENT_STORE_ID` (`store_id`),
  CONSTRAINT `[[DBPREFIX]]PAYPAL_BILLING_AGREEMENT_STORE_ID_[[DBPREFIX]]STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE SET NULL,
  CONSTRAINT `[[DBPREFIX]]PAYPAL_BILLING_AGRT_CSTR_ID_[[DBPREFIX]]CSTR_ENTT_ENTT_ID` FOREIGN KEY (`customer_id`) REFERENCES `[[dbprefix]]customer_entity` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Billing Agreement';

--
-- Dumping data for table `[[dbprefix]]paypal_billing_agreement`
--


--
-- Table structure for table `[[dbprefix]]paypal_billing_agreement_order`
--

CREATE TABLE `[[dbprefix]]paypal_billing_agreement_order` (
  `agreement_id` int unsigned NOT NULL COMMENT 'Agreement ID',
  `order_id` int unsigned NOT NULL COMMENT 'Order ID',
  PRIMARY KEY (`agreement_id`,`order_id`),
  KEY `[[DBPREFIX]]PAYPAL_BILLING_AGREEMENT_ORDER_ORDER_ID` (`order_id`),
  CONSTRAINT `FK_9EE0F3B5AE741E1A1BDDF5A663BFCB42` FOREIGN KEY (`agreement_id`) REFERENCES `[[dbprefix]]paypal_billing_agreement` (`agreement_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]PAYPAL_BILLING_AGRT_ORDER_ORDER_ID_[[DBPREFIX]]SALES_ORDER_ENTT_ID` FOREIGN KEY (`order_id`) REFERENCES `[[dbprefix]]sales_order` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Billing Agreement Order';

--
-- Dumping data for table `[[dbprefix]]paypal_billing_agreement_order`
--


--
-- Table structure for table `[[dbprefix]]paypal_cert`
--

CREATE TABLE `[[dbprefix]]paypal_cert` (
  `cert_id` smallint unsigned NOT NULL AUTO_INCREMENT COMMENT 'Cert ID',
  `website_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Website ID',
  `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Content',
  `updated_at` timestamp NULL DEFAULT NULL COMMENT 'Updated At',
  PRIMARY KEY (`cert_id`),
  KEY `[[DBPREFIX]]PAYPAL_CERT_WEBSITE_ID` (`website_id`),
  CONSTRAINT `[[DBPREFIX]]PAYPAL_CERT_WEBSITE_ID_[[DBPREFIX]]STORE_WEBSITE_WEBSITE_ID` FOREIGN KEY (`website_id`) REFERENCES `[[dbprefix]]store_website` (`website_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Paypal Certificate Table';

--
-- Dumping data for table `[[dbprefix]]paypal_cert`
--


--
-- Table structure for table `[[dbprefix]]paypal_payment_transaction`
--

CREATE TABLE `[[dbprefix]]paypal_payment_transaction` (
  `transaction_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `txn_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Txn ID',
  `additional_information` blob COMMENT 'Additional Information',
  `created_at` timestamp NULL DEFAULT NULL COMMENT 'Created At',
  PRIMARY KEY (`transaction_id`),
  UNIQUE KEY `[[DBPREFIX]]PAYPAL_PAYMENT_TRANSACTION_TXN_ID` (`txn_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='PayPal Payflow Link Payment Transaction';

--
-- Dumping data for table `[[dbprefix]]paypal_payment_transaction`
--


--
-- Table structure for table `[[dbprefix]]paypal_settlement_report`
--

CREATE TABLE `[[dbprefix]]paypal_settlement_report` (
  `report_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Report ID',
  `report_date` date DEFAULT NULL COMMENT 'Report Date',
  `account_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Account ID',
  `filename` varchar(24) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Filename',
  `last_modified` timestamp NULL DEFAULT NULL COMMENT 'Last Modified',
  PRIMARY KEY (`report_id`),
  UNIQUE KEY `[[DBPREFIX]]PAYPAL_SETTLEMENT_REPORT_REPORT_DATE_ACCOUNT_ID` (`report_date`,`account_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Paypal Settlement Report Table';

--
-- Dumping data for table `[[dbprefix]]paypal_settlement_report`
--


--
-- Table structure for table `[[dbprefix]]paypal_settlement_report_row`
--

CREATE TABLE `[[dbprefix]]paypal_settlement_report_row` (
  `row_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Row ID',
  `report_id` int unsigned NOT NULL COMMENT 'Report ID',
  `transaction_id` varchar(19) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Transaction ID',
  `invoice_id` varchar(127) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Invoice ID',
  `paypal_reference_id` varchar(19) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Paypal Reference ID',
  `paypal_reference_id_type` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Paypal Reference ID Type',
  `transaction_event_code` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Transaction Event Code',
  `transaction_initiation_date` timestamp NULL DEFAULT NULL COMMENT 'Transaction Initiation Date',
  `transaction_completion_date` timestamp NULL DEFAULT NULL COMMENT 'Transaction Completion Date',
  `transaction_debit_or_credit` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'CR' COMMENT 'Transaction Debit Or Credit',
  `gross_transaction_amount` decimal(20,6) NOT NULL DEFAULT '0.000000' COMMENT 'Gross Transaction Amount',
  `gross_transaction_currency` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Gross Transaction Currency',
  `fee_debit_or_credit` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Fee Debit Or Credit',
  `fee_amount` decimal(20,6) NOT NULL DEFAULT '0.000000' COMMENT 'Fee Amount',
  `fee_currency` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Fee Currency',
  `custom_field` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Custom Field',
  `consumer_id` varchar(127) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Consumer ID',
  `payment_tracking_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Payment Tracking ID',
  `store_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Store ID',
  PRIMARY KEY (`row_id`),
  KEY `[[DBPREFIX]]PAYPAL_SETTLEMENT_REPORT_ROW_REPORT_ID` (`report_id`),
  CONSTRAINT `FK_4B9222F51A9075175B75AB5C187FBFBF` FOREIGN KEY (`report_id`) REFERENCES `[[dbprefix]]paypal_settlement_report` (`report_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Paypal Settlement Report Row Table';

--
-- Dumping data for table `[[dbprefix]]paypal_settlement_report_row`
--


--
-- Table structure for table `[[dbprefix]]persistent_session`
--

CREATE TABLE `[[dbprefix]]persistent_session` (
  `persistent_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Session ID',
  `key` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Unique cookie key',
  `customer_id` int unsigned DEFAULT NULL COMMENT 'Customer ID',
  `website_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Website ID',
  `info` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Session Data',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Updated At',
  PRIMARY KEY (`persistent_id`),
  UNIQUE KEY `[[DBPREFIX]]PERSISTENT_SESSION_KEY` (`key`),
  UNIQUE KEY `[[DBPREFIX]]PERSISTENT_SESSION_CUSTOMER_ID` (`customer_id`),
  KEY `[[DBPREFIX]]PERSISTENT_SESSION_WEBSITE_ID_[[DBPREFIX]]STORE_WEBSITE_WEBSITE_ID` (`website_id`),
  KEY `[[DBPREFIX]]PERSISTENT_SESSION_UPDATED_AT` (`updated_at`),
  CONSTRAINT `[[DBPREFIX]]PERSISTENT_SESS_CSTR_ID_[[DBPREFIX]]CSTR_ENTT_ENTT_ID` FOREIGN KEY (`customer_id`) REFERENCES `[[dbprefix]]customer_entity` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]PERSISTENT_SESSION_WEBSITE_ID_[[DBPREFIX]]STORE_WEBSITE_WEBSITE_ID` FOREIGN KEY (`website_id`) REFERENCES `[[dbprefix]]store_website` (`website_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Persistent Session';

--
-- Dumping data for table `[[dbprefix]]persistent_session`
--


--
-- Table structure for table `[[dbprefix]]product_alert_price`
--

CREATE TABLE `[[dbprefix]]product_alert_price` (
  `alert_price_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Product alert price ID',
  `customer_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Customer ID',
  `product_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Product ID',
  `price` decimal(20,6) NOT NULL DEFAULT '0.000000' COMMENT 'Price amount',
  `website_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Website ID',
  `store_id` smallint unsigned DEFAULT '0' COMMENT 'Store ID',
  `add_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Product alert add date',
  `last_send_date` timestamp NULL DEFAULT NULL COMMENT 'Product alert last send date',
  `send_count` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Product alert send count',
  `status` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Product alert status',
  PRIMARY KEY (`alert_price_id`),
  KEY `[[DBPREFIX]]PRODUCT_ALERT_PRICE_CUSTOMER_ID` (`customer_id`),
  KEY `[[DBPREFIX]]PRODUCT_ALERT_PRICE_PRODUCT_ID` (`product_id`),
  KEY `[[DBPREFIX]]PRODUCT_ALERT_PRICE_WEBSITE_ID` (`website_id`),
  KEY `[[DBPREFIX]]PRODUCT_ALERT_PRICE_STORE_ID` (`store_id`),
  CONSTRAINT `[[DBPREFIX]]PRD_ALERT_PRICE_CSTR_ID_[[DBPREFIX]]CSTR_ENTT_ENTT_ID` FOREIGN KEY (`customer_id`) REFERENCES `[[dbprefix]]customer_entity` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]PRD_ALERT_PRICE_PRD_ID_[[DBPREFIX]]CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `[[dbprefix]]catalog_product_entity` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]PRD_ALERT_PRICE_WS_ID_[[DBPREFIX]]STORE_WS_WS_ID` FOREIGN KEY (`website_id`) REFERENCES `[[dbprefix]]store_website` (`website_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]PRODUCT_ALERT_PRICE_STORE_ID_[[DBPREFIX]]STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Product Alert Price';

--
-- Dumping data for table `[[dbprefix]]product_alert_price`
--


--
-- Table structure for table `[[dbprefix]]product_alert_stock`
--

CREATE TABLE `[[dbprefix]]product_alert_stock` (
  `alert_stock_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Product alert stock ID',
  `customer_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Customer ID',
  `product_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Product ID',
  `website_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Website ID',
  `store_id` smallint unsigned DEFAULT '0' COMMENT 'Store ID',
  `add_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Product alert add date',
  `send_date` timestamp NULL DEFAULT NULL COMMENT 'Product alert send date',
  `send_count` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Send Count',
  `status` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Product alert status',
  PRIMARY KEY (`alert_stock_id`),
  KEY `[[DBPREFIX]]PRODUCT_ALERT_STOCK_CUSTOMER_ID` (`customer_id`),
  KEY `[[DBPREFIX]]PRODUCT_ALERT_STOCK_PRODUCT_ID` (`product_id`),
  KEY `[[DBPREFIX]]PRODUCT_ALERT_STOCK_WEBSITE_ID` (`website_id`),
  KEY `[[DBPREFIX]]PRODUCT_ALERT_STOCK_STORE_ID` (`store_id`),
  CONSTRAINT `[[DBPREFIX]]PRD_ALERT_STOCK_CSTR_ID_[[DBPREFIX]]CSTR_ENTT_ENTT_ID` FOREIGN KEY (`customer_id`) REFERENCES `[[dbprefix]]customer_entity` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]PRD_ALERT_STOCK_PRD_ID_[[DBPREFIX]]CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `[[dbprefix]]catalog_product_entity` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]PRD_ALERT_STOCK_WS_ID_[[DBPREFIX]]STORE_WS_WS_ID` FOREIGN KEY (`website_id`) REFERENCES `[[dbprefix]]store_website` (`website_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]PRODUCT_ALERT_STOCK_STORE_ID_[[DBPREFIX]]STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Product Alert Stock';

--
-- Dumping data for table `[[dbprefix]]product_alert_stock`
--


--
-- Table structure for table `[[dbprefix]]queue`
--

CREATE TABLE `[[dbprefix]]queue` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Queue ID',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Queue name',
  PRIMARY KEY (`id`),
  UNIQUE KEY `[[DBPREFIX]]QUEUE_NAME` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8mb4 COMMENT='Table storing unique queues';

--
-- Dumping data for table `[[dbprefix]]queue`
--

INSERT INTO `[[dbprefix]]queue` VALUES (21,'async.operations.all'),(3,'catalog_website_attribute_value_sync'),(16,'codegenerator'),(5,'export'),(11,'inventory.indexer.sourceItem'),(12,'inventory.indexer.stock'),(7,'inventory.mass.update'),(8,'inventory.reservations.cleanup'),(9,'inventory.reservations.update'),(10,'inventory.reservations.updateSalabilityStatus'),(6,'inventory.source.items.cleanup'),(13,'media.content.synchronization'),(14,'media.gallery.renditions.update'),(15,'media.gallery.synchronization'),(4,'media.storage.catalog.image.resize'),(1,'product_action_attribute.update'),(2,'product_action_attribute.website.update'),(19,'product_alert.queue'),(18,'sales.rule.quote.trigger.recollect'),(17,'sales.rule.update.coupon.usage'),(20,'saveConfig');

--
-- Table structure for table `[[dbprefix]]queue_lock`
--

CREATE TABLE `[[dbprefix]]queue_lock` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Message ID',
  `message_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'Message Code',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Created At',
  PRIMARY KEY (`id`),
  UNIQUE KEY `[[DBPREFIX]]QUEUE_LOCK_MESSAGE_CODE` (`message_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Messages that were processed are inserted here to be locked.';

--
-- Dumping data for table `[[dbprefix]]queue_lock`
--


--
-- Table structure for table `[[dbprefix]]queue_message`
--

CREATE TABLE `[[dbprefix]]queue_message` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'Message ID',
  `topic_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Message topic',
  `body` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Message body',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Queue messages';

--
-- Dumping data for table `[[dbprefix]]queue_message`
--


--
-- Table structure for table `[[dbprefix]]queue_message_status`
--

CREATE TABLE `[[dbprefix]]queue_message_status` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'Relation ID',
  `queue_id` int unsigned NOT NULL COMMENT 'Queue ID',
  `message_id` bigint unsigned NOT NULL COMMENT 'Message ID',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Updated At',
  `status` smallint unsigned NOT NULL COMMENT 'Message status in particular queue',
  `number_of_trials` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Number of trials to processed failed message processing',
  PRIMARY KEY (`id`),
  UNIQUE KEY `[[DBPREFIX]]QUEUE_MESSAGE_STATUS_QUEUE_ID_MESSAGE_ID` (`queue_id`,`message_id`),
  KEY `[[DBPREFIX]]QUEUE_MESSAGE_STATUS_MESSAGE_ID_[[DBPREFIX]]QUEUE_MESSAGE_ID` (`message_id`),
  KEY `[[DBPREFIX]]QUEUE_MESSAGE_STATUS_STATUS_UPDATED_AT` (`status`,`updated_at`),
  CONSTRAINT `[[DBPREFIX]]QUEUE_MESSAGE_STATUS_MESSAGE_ID_[[DBPREFIX]]QUEUE_MESSAGE_ID` FOREIGN KEY (`message_id`) REFERENCES `[[dbprefix]]queue_message` (`id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]QUEUE_MESSAGE_STATUS_QUEUE_ID_[[DBPREFIX]]QUEUE_ID` FOREIGN KEY (`queue_id`) REFERENCES `[[dbprefix]]queue` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Relation table to keep associations between queues and messages';

--
-- Dumping data for table `[[dbprefix]]queue_message_status`
--


--
-- Table structure for table `[[dbprefix]]queue_poison_pill`
--

CREATE TABLE `[[dbprefix]]queue_poison_pill` (
  `version` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Poison Pill version.'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sequence table for poison pill versions';

--
-- Dumping data for table `[[dbprefix]]queue_poison_pill`
--

INSERT INTO `[[dbprefix]]queue_poison_pill` VALUES ('version-67f74eafca694');

--
-- Table structure for table `[[dbprefix]]quote`
--

CREATE TABLE `[[dbprefix]]quote` (
  `entity_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `store_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Store ID',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Created At',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `converted_at` timestamp NULL DEFAULT NULL COMMENT 'Converted At',
  `is_active` smallint unsigned DEFAULT '1' COMMENT 'Is Active',
  `is_virtual` smallint unsigned DEFAULT '0' COMMENT 'Is Virtual',
  `is_multi_shipping` smallint unsigned DEFAULT '0' COMMENT 'Is Multi Shipping',
  `items_count` int unsigned DEFAULT '0' COMMENT 'Items Count',
  `items_qty` decimal(12,4) DEFAULT '0.0000' COMMENT 'Items Qty',
  `orig_order_id` int unsigned DEFAULT '0' COMMENT 'Orig Order ID',
  `store_to_base_rate` decimal(12,4) DEFAULT '0.0000' COMMENT 'Store To Base Rate',
  `store_to_quote_rate` decimal(12,4) DEFAULT '0.0000' COMMENT 'Store To Quote Rate',
  `base_currency_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Base Currency Code',
  `store_currency_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Store Currency Code',
  `quote_currency_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Quote Currency Code',
  `grand_total` decimal(20,4) DEFAULT '0.0000' COMMENT 'Grand Total',
  `base_grand_total` decimal(20,4) DEFAULT '0.0000' COMMENT 'Base Grand Total',
  `checkout_method` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Checkout Method',
  `customer_id` int unsigned DEFAULT NULL COMMENT 'Customer ID',
  `customer_tax_class_id` int unsigned DEFAULT NULL COMMENT 'Customer Tax Class ID',
  `customer_group_id` int unsigned DEFAULT '0' COMMENT 'Customer Group ID',
  `customer_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Customer Email',
  `customer_prefix` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Customer Prefix',
  `customer_firstname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Customer Firstname',
  `customer_middlename` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Customer Middlename',
  `customer_lastname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Customer Lastname',
  `customer_suffix` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Customer Suffix',
  `customer_dob` datetime DEFAULT NULL COMMENT 'Customer Dob',
  `customer_note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Customer Note',
  `customer_note_notify` smallint unsigned DEFAULT '1' COMMENT 'Customer Note Notify',
  `customer_is_guest` smallint unsigned DEFAULT '0' COMMENT 'Customer Is Guest',
  `remote_ip` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Remote Ip',
  `applied_rule_ids` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Applied Rule Ids',
  `reserved_order_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Reserved Order ID',
  `password_hash` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Password Hash',
  `coupon_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Coupon Code',
  `global_currency_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Global Currency Code',
  `base_to_global_rate` decimal(20,4) DEFAULT NULL COMMENT 'Base To Global Rate',
  `base_to_quote_rate` decimal(20,4) DEFAULT NULL COMMENT 'Base To Quote Rate',
  `customer_taxvat` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Customer Taxvat',
  `customer_gender` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Customer Gender',
  `subtotal` decimal(20,4) DEFAULT NULL COMMENT 'Subtotal',
  `base_subtotal` decimal(20,4) DEFAULT NULL COMMENT 'Base Subtotal',
  `subtotal_with_discount` decimal(20,4) DEFAULT NULL COMMENT 'Subtotal With Discount',
  `base_subtotal_with_discount` decimal(20,4) DEFAULT NULL COMMENT 'Base Subtotal With Discount',
  `is_changed` int unsigned DEFAULT NULL COMMENT 'Is Changed',
  `trigger_recollect` smallint NOT NULL DEFAULT '0' COMMENT 'Trigger Recollect',
  `ext_shipping_info` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Ext Shipping Info',
  `gift_message_id` int DEFAULT NULL COMMENT 'Gift Message ID',
  `is_persistent` smallint unsigned DEFAULT '0' COMMENT 'Is Quote Persistent',
  PRIMARY KEY (`entity_id`),
  KEY `[[DBPREFIX]]QUOTE_CUSTOMER_ID_STORE_ID_IS_ACTIVE` (`customer_id`,`store_id`,`is_active`),
  KEY `[[DBPREFIX]]QUOTE_STORE_ID_UPDATED_AT` (`store_id`,`updated_at`),
  CONSTRAINT `[[DBPREFIX]]QUOTE_STORE_ID_[[DBPREFIX]]STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Flat Quote';

--
-- Dumping data for table `[[dbprefix]]quote`
--


--
-- Table structure for table `[[dbprefix]]quote_address`
--

CREATE TABLE `[[dbprefix]]quote_address` (
  `address_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Address ID',
  `quote_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Quote ID',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Created At',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Updated At',
  `customer_id` int unsigned DEFAULT NULL COMMENT 'Customer ID',
  `save_in_address_book` smallint DEFAULT '0' COMMENT 'Save In Address Book',
  `customer_address_id` int unsigned DEFAULT NULL COMMENT 'Customer Address ID',
  `address_type` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Address Type',
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Email',
  `prefix` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Prefix',
  `firstname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `middlename` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `lastname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `suffix` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Suffix',
  `company` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Company',
  `street` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Street',
  `city` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `region` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `region_id` int unsigned DEFAULT NULL COMMENT 'Region ID',
  `postcode` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Postcode',
  `country_id` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Country ID',
  `telephone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `fax` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `same_as_billing` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Same As Billing',
  `collect_shipping_rates` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Collect Shipping Rates',
  `shipping_method` varchar(120) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `shipping_description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Shipping Description',
  `weight` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Weight',
  `subtotal` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Subtotal',
  `base_subtotal` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Base Subtotal',
  `subtotal_with_discount` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Subtotal With Discount',
  `base_subtotal_with_discount` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Base Subtotal With Discount',
  `tax_amount` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Tax Amount',
  `base_tax_amount` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Base Tax Amount',
  `shipping_amount` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Shipping Amount',
  `base_shipping_amount` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Base Shipping Amount',
  `shipping_tax_amount` decimal(20,4) DEFAULT NULL COMMENT 'Shipping Tax Amount',
  `base_shipping_tax_amount` decimal(20,4) DEFAULT NULL COMMENT 'Base Shipping Tax Amount',
  `discount_amount` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Discount Amount',
  `base_discount_amount` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Base Discount Amount',
  `grand_total` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Grand Total',
  `base_grand_total` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Base Grand Total',
  `customer_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Customer Notes',
  `applied_taxes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Applied Taxes',
  `discount_description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Discount Description',
  `shipping_discount_amount` decimal(20,4) DEFAULT NULL COMMENT 'Shipping Discount Amount',
  `base_shipping_discount_amount` decimal(20,4) DEFAULT NULL COMMENT 'Base Shipping Discount Amount',
  `subtotal_incl_tax` decimal(20,4) DEFAULT NULL COMMENT 'Subtotal Incl Tax',
  `base_subtotal_total_incl_tax` decimal(20,4) DEFAULT NULL COMMENT 'Base Subtotal Total Incl Tax',
  `discount_tax_compensation_amount` decimal(20,4) DEFAULT NULL COMMENT 'Discount Tax Compensation Amount',
  `base_discount_tax_compensation_amount` decimal(20,4) DEFAULT NULL COMMENT 'Base Discount Tax Compensation Amount',
  `shipping_discount_tax_compensation_amount` decimal(20,4) DEFAULT NULL COMMENT 'Shipping Discount Tax Compensation Amount',
  `base_shipping_discount_tax_compensation_amnt` decimal(20,4) DEFAULT NULL COMMENT 'Base Shipping Discount Tax Compensation Amount',
  `shipping_incl_tax` decimal(20,4) DEFAULT NULL COMMENT 'Shipping Incl Tax',
  `base_shipping_incl_tax` decimal(20,4) DEFAULT NULL COMMENT 'Base Shipping Incl Tax',
  `vat_id` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Vat ID',
  `vat_is_valid` smallint DEFAULT NULL COMMENT 'Vat Is Valid',
  `vat_request_id` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Vat Request ID',
  `vat_request_date` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Vat Request Date',
  `vat_request_success` smallint DEFAULT NULL COMMENT 'Vat Request Success',
  `validated_country_code` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Validated Country Code',
  `validated_vat_number` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Validated Vat Number',
  `gift_message_id` int DEFAULT NULL COMMENT 'Gift Message ID',
  `free_shipping` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Free Shipping',
  PRIMARY KEY (`address_id`),
  KEY `[[DBPREFIX]]QUOTE_ADDRESS_QUOTE_ID` (`quote_id`),
  CONSTRAINT `[[DBPREFIX]]QUOTE_ADDRESS_QUOTE_ID_[[DBPREFIX]]QUOTE_ENTITY_ID` FOREIGN KEY (`quote_id`) REFERENCES `[[dbprefix]]quote` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Flat Quote Address';

--
-- Dumping data for table `[[dbprefix]]quote_address`
--


--
-- Table structure for table `[[dbprefix]]quote_address_item`
--

CREATE TABLE `[[dbprefix]]quote_address_item` (
  `address_item_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Address Item ID',
  `parent_item_id` int unsigned DEFAULT NULL COMMENT 'Parent Item ID',
  `quote_address_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Quote Address ID',
  `quote_item_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Quote Item ID',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Created At',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Updated At',
  `applied_rule_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Applied Rule Ids',
  `additional_data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Additional Data',
  `weight` decimal(12,4) DEFAULT '0.0000' COMMENT 'Weight',
  `qty` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Qty',
  `discount_amount` decimal(20,4) DEFAULT '0.0000' COMMENT 'Discount Amount',
  `tax_amount` decimal(20,4) DEFAULT '0.0000' COMMENT 'Tax Amount',
  `row_total` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Row Total',
  `base_row_total` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Base Row Total',
  `row_total_with_discount` decimal(20,4) DEFAULT '0.0000' COMMENT 'Row Total With Discount',
  `base_discount_amount` decimal(20,4) DEFAULT '0.0000' COMMENT 'Base Discount Amount',
  `base_tax_amount` decimal(20,4) DEFAULT '0.0000' COMMENT 'Base Tax Amount',
  `row_weight` decimal(12,4) DEFAULT '0.0000' COMMENT 'Row Weight',
  `product_id` int unsigned DEFAULT NULL COMMENT 'Product ID',
  `super_product_id` int unsigned DEFAULT NULL COMMENT 'Super Product ID',
  `parent_product_id` int unsigned DEFAULT NULL COMMENT 'Parent Product ID',
  `store_id` smallint unsigned DEFAULT NULL COMMENT 'Store ID',
  `sku` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Sku',
  `image` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Image',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Name',
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Description',
  `is_qty_decimal` int unsigned DEFAULT NULL COMMENT 'Is Qty Decimal',
  `price` decimal(12,4) DEFAULT NULL COMMENT 'Price',
  `discount_percent` decimal(12,4) DEFAULT NULL COMMENT 'Discount Percent',
  `no_discount` int unsigned DEFAULT NULL COMMENT 'No Discount',
  `tax_percent` decimal(12,4) DEFAULT NULL COMMENT 'Tax Percent',
  `base_price` decimal(20,4) DEFAULT NULL COMMENT 'Base Price',
  `base_cost` decimal(20,4) DEFAULT NULL COMMENT 'Base Cost',
  `price_incl_tax` decimal(20,4) DEFAULT NULL COMMENT 'Price Incl Tax',
  `base_price_incl_tax` decimal(20,4) DEFAULT NULL COMMENT 'Base Price Incl Tax',
  `row_total_incl_tax` decimal(20,4) DEFAULT NULL COMMENT 'Row Total Incl Tax',
  `base_row_total_incl_tax` decimal(20,4) DEFAULT NULL COMMENT 'Base Row Total Incl Tax',
  `discount_tax_compensation_amount` decimal(20,4) DEFAULT NULL COMMENT 'Discount Tax Compensation Amount',
  `base_discount_tax_compensation_amount` decimal(20,4) DEFAULT NULL COMMENT 'Base Discount Tax Compensation Amount',
  `gift_message_id` int DEFAULT NULL COMMENT 'Gift Message ID',
  `free_shipping` int unsigned DEFAULT NULL COMMENT 'Free Shipping',
  PRIMARY KEY (`address_item_id`),
  KEY `[[DBPREFIX]]QUOTE_ADDRESS_ITEM_QUOTE_ADDRESS_ID` (`quote_address_id`),
  KEY `[[DBPREFIX]]QUOTE_ADDRESS_ITEM_PARENT_ITEM_ID` (`parent_item_id`),
  KEY `[[DBPREFIX]]QUOTE_ADDRESS_ITEM_QUOTE_ITEM_ID` (`quote_item_id`),
  KEY `[[DBPREFIX]]QUOTE_ADDRESS_ITEM_STORE_ID` (`store_id`),
  CONSTRAINT `FK_C8DC8D276B1E4E72CF56C0BA214DC849` FOREIGN KEY (`parent_item_id`) REFERENCES `[[dbprefix]]quote_address_item` (`address_item_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]QUOTE_ADDR_ITEM_QUOTE_ADDR_ID_[[DBPREFIX]]QUOTE_ADDR_ADDR_ID` FOREIGN KEY (`quote_address_id`) REFERENCES `[[dbprefix]]quote_address` (`address_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]QUOTE_ADDRESS_ITEM_QUOTE_ITEM_ID_[[DBPREFIX]]QUOTE_ITEM_ITEM_ID` FOREIGN KEY (`quote_item_id`) REFERENCES `[[dbprefix]]quote_item` (`item_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Flat Quote Address Item';

--
-- Dumping data for table `[[dbprefix]]quote_address_item`
--


--
-- Table structure for table `[[dbprefix]]quote_id_mask`
--

CREATE TABLE `[[dbprefix]]quote_id_mask` (
  `entity_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `quote_id` int unsigned NOT NULL COMMENT 'Quote ID',
  `masked_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Masked ID',
  PRIMARY KEY (`entity_id`,`quote_id`),
  KEY `[[DBPREFIX]]QUOTE_ID_MASK_QUOTE_ID` (`quote_id`),
  KEY `[[DBPREFIX]]QUOTE_ID_MASK_MASKED_ID` (`masked_id`),
  CONSTRAINT `[[DBPREFIX]]QUOTE_ID_MASK_QUOTE_ID_[[DBPREFIX]]QUOTE_ENTITY_ID` FOREIGN KEY (`quote_id`) REFERENCES `[[dbprefix]]quote` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Quote ID and masked ID mapping';

--
-- Dumping data for table `[[dbprefix]]quote_id_mask`
--


--
-- Table structure for table `[[dbprefix]]quote_item`
--

CREATE TABLE `[[dbprefix]]quote_item` (
  `item_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Item ID',
  `quote_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Quote ID',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Created At',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Updated At',
  `product_id` int unsigned DEFAULT NULL COMMENT 'Product ID',
  `store_id` smallint unsigned DEFAULT NULL COMMENT 'Store ID',
  `parent_item_id` int unsigned DEFAULT NULL COMMENT 'Parent Item ID',
  `is_virtual` smallint unsigned DEFAULT NULL COMMENT 'Is Virtual',
  `sku` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Sku',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Name',
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Description',
  `applied_rule_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Applied Rule Ids',
  `additional_data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Additional Data',
  `is_qty_decimal` smallint unsigned DEFAULT NULL COMMENT 'Is Qty Decimal',
  `no_discount` smallint unsigned DEFAULT '0' COMMENT 'No Discount',
  `weight` decimal(12,4) DEFAULT '0.0000' COMMENT 'Weight',
  `qty` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Qty',
  `price` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Price',
  `base_price` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Base Price',
  `custom_price` decimal(20,4) DEFAULT NULL COMMENT 'Custom Price',
  `discount_percent` decimal(12,4) DEFAULT '0.0000' COMMENT 'Discount Percent',
  `discount_amount` decimal(20,4) DEFAULT '0.0000' COMMENT 'Discount Amount',
  `base_discount_amount` decimal(20,4) DEFAULT '0.0000' COMMENT 'Base Discount Amount',
  `tax_percent` decimal(12,4) DEFAULT '0.0000' COMMENT 'Tax Percent',
  `tax_amount` decimal(20,4) DEFAULT '0.0000' COMMENT 'Tax Amount',
  `base_tax_amount` decimal(20,4) DEFAULT '0.0000' COMMENT 'Base Tax Amount',
  `row_total` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Row Total',
  `base_row_total` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Base Row Total',
  `row_total_with_discount` decimal(20,4) DEFAULT '0.0000' COMMENT 'Row Total With Discount',
  `row_weight` decimal(12,4) DEFAULT '0.0000' COMMENT 'Row Weight',
  `product_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Product Type',
  `base_tax_before_discount` decimal(20,4) DEFAULT NULL COMMENT 'Base Tax Before Discount',
  `tax_before_discount` decimal(20,4) DEFAULT NULL COMMENT 'Tax Before Discount',
  `original_custom_price` decimal(20,4) DEFAULT NULL COMMENT 'Original Custom Price',
  `redirect_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Redirect Url',
  `base_cost` decimal(12,4) DEFAULT NULL COMMENT 'Base Cost',
  `price_incl_tax` decimal(20,4) DEFAULT NULL COMMENT 'Price Incl Tax',
  `base_price_incl_tax` decimal(20,4) DEFAULT NULL COMMENT 'Base Price Incl Tax',
  `row_total_incl_tax` decimal(20,4) DEFAULT NULL COMMENT 'Row Total Incl Tax',
  `base_row_total_incl_tax` decimal(20,4) DEFAULT NULL COMMENT 'Base Row Total Incl Tax',
  `discount_tax_compensation_amount` decimal(20,4) DEFAULT NULL COMMENT 'Discount Tax Compensation Amount',
  `base_discount_tax_compensation_amount` decimal(20,4) DEFAULT NULL COMMENT 'Base Discount Tax Compensation Amount',
  `gift_message_id` int DEFAULT NULL COMMENT 'Gift Message ID',
  `free_shipping` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Free Shipping',
  `weee_tax_applied` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Weee Tax Applied',
  `weee_tax_applied_amount` decimal(12,4) DEFAULT NULL COMMENT 'Weee Tax Applied Amount',
  `weee_tax_applied_row_amount` decimal(12,4) DEFAULT NULL COMMENT 'Weee Tax Applied Row Amount',
  `weee_tax_disposition` decimal(12,4) DEFAULT NULL COMMENT 'Weee Tax Disposition',
  `weee_tax_row_disposition` decimal(12,4) DEFAULT NULL COMMENT 'Weee Tax Row Disposition',
  `base_weee_tax_applied_amount` decimal(12,4) DEFAULT NULL COMMENT 'Base Weee Tax Applied Amount',
  `base_weee_tax_applied_row_amnt` decimal(12,4) DEFAULT NULL COMMENT 'Base Weee Tax Applied Row Amnt',
  `base_weee_tax_disposition` decimal(12,4) DEFAULT NULL COMMENT 'Base Weee Tax Disposition',
  `base_weee_tax_row_disposition` decimal(12,4) DEFAULT NULL COMMENT 'Base Weee Tax Row Disposition',
  PRIMARY KEY (`item_id`),
  KEY `[[DBPREFIX]]QUOTE_ITEM_PARENT_ITEM_ID` (`parent_item_id`),
  KEY `[[DBPREFIX]]QUOTE_ITEM_PRODUCT_ID` (`product_id`),
  KEY `[[DBPREFIX]]QUOTE_ITEM_QUOTE_ID` (`quote_id`),
  KEY `[[DBPREFIX]]QUOTE_ITEM_STORE_ID` (`store_id`),
  CONSTRAINT `[[DBPREFIX]]QUOTE_ITEM_PARENT_ITEM_ID_[[DBPREFIX]]QUOTE_ITEM_ITEM_ID` FOREIGN KEY (`parent_item_id`) REFERENCES `[[dbprefix]]quote_item` (`item_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]QUOTE_ITEM_QUOTE_ID_[[DBPREFIX]]QUOTE_ENTITY_ID` FOREIGN KEY (`quote_id`) REFERENCES `[[dbprefix]]quote` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]QUOTE_ITEM_STORE_ID_[[DBPREFIX]]STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Flat Quote Item';

--
-- Dumping data for table `[[dbprefix]]quote_item`
--


--
-- Table structure for table `[[dbprefix]]quote_item_option`
--

CREATE TABLE `[[dbprefix]]quote_item_option` (
  `option_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Option ID',
  `item_id` int unsigned NOT NULL COMMENT 'Item ID',
  `product_id` int unsigned NOT NULL COMMENT 'Product ID',
  `code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Code',
  `value` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Value',
  PRIMARY KEY (`option_id`),
  KEY `[[DBPREFIX]]QUOTE_ITEM_OPTION_ITEM_ID` (`item_id`),
  CONSTRAINT `[[DBPREFIX]]QUOTE_ITEM_OPTION_ITEM_ID_[[DBPREFIX]]QUOTE_ITEM_ITEM_ID` FOREIGN KEY (`item_id`) REFERENCES `[[dbprefix]]quote_item` (`item_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Flat Quote Item Option';

--
-- Dumping data for table `[[dbprefix]]quote_item_option`
--


--
-- Table structure for table `[[dbprefix]]quote_payment`
--

CREATE TABLE `[[dbprefix]]quote_payment` (
  `payment_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Payment ID',
  `quote_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Quote ID',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Created At',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Updated At',
  `method` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Method',
  `cc_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Cc Type',
  `cc_number_enc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Cc Number Enc',
  `cc_last_4` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Cc Last 4',
  `cc_cid_enc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Cc Cid Enc',
  `cc_owner` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Cc Owner',
  `cc_exp_month` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Cc Exp Month',
  `cc_exp_year` smallint unsigned DEFAULT '0' COMMENT 'Cc Exp Year',
  `cc_ss_owner` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Cc Ss Owner',
  `cc_ss_start_month` smallint unsigned DEFAULT '0' COMMENT 'Cc Ss Start Month',
  `cc_ss_start_year` smallint unsigned DEFAULT '0' COMMENT 'Cc Ss Start Year',
  `po_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Po Number',
  `additional_data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Additional Data',
  `cc_ss_issue` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Cc Ss Issue',
  `additional_information` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Additional Information',
  `paypal_payer_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Paypal Payer ID',
  `paypal_payer_status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Paypal Payer Status',
  `paypal_correlation_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Paypal Correlation ID',
  PRIMARY KEY (`payment_id`),
  KEY `[[DBPREFIX]]QUOTE_PAYMENT_QUOTE_ID` (`quote_id`),
  CONSTRAINT `[[DBPREFIX]]QUOTE_PAYMENT_QUOTE_ID_[[DBPREFIX]]QUOTE_ENTITY_ID` FOREIGN KEY (`quote_id`) REFERENCES `[[dbprefix]]quote` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Flat Quote Payment';

--
-- Dumping data for table `[[dbprefix]]quote_payment`
--


--
-- Table structure for table `[[dbprefix]]quote_shipping_rate`
--

CREATE TABLE `[[dbprefix]]quote_shipping_rate` (
  `rate_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Rate ID',
  `address_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Address ID',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Created At',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Updated At',
  `carrier` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Carrier',
  `carrier_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Carrier Title',
  `code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Code',
  `method` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Method',
  `method_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Method Description',
  `price` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Price',
  `error_message` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Error Message',
  `method_title` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Method Title',
  PRIMARY KEY (`rate_id`),
  KEY `[[DBPREFIX]]QUOTE_SHIPPING_RATE_ADDRESS_ID` (`address_id`),
  CONSTRAINT `[[DBPREFIX]]QUOTE_SHPP_RATE_ADDR_ID_[[DBPREFIX]]QUOTE_ADDR_ADDR_ID` FOREIGN KEY (`address_id`) REFERENCES `[[dbprefix]]quote_address` (`address_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Flat Quote Shipping Rate';

--
-- Dumping data for table `[[dbprefix]]quote_shipping_rate`
--


--
-- Table structure for table `[[dbprefix]]rating`
--

CREATE TABLE `[[dbprefix]]rating` (
  `rating_id` smallint unsigned NOT NULL AUTO_INCREMENT COMMENT 'Rating ID',
  `entity_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Entity ID',
  `rating_code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Rating Code',
  `position` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Rating Position On Storefront',
  `is_active` smallint NOT NULL DEFAULT '1' COMMENT 'Rating is active.',
  PRIMARY KEY (`rating_id`),
  UNIQUE KEY `[[DBPREFIX]]RATING_RATING_CODE` (`rating_code`),
  KEY `[[DBPREFIX]]RATING_ENTITY_ID` (`entity_id`),
  CONSTRAINT `[[DBPREFIX]]RATING_ENTITY_ID_[[DBPREFIX]]RATING_ENTITY_ENTITY_ID` FOREIGN KEY (`entity_id`) REFERENCES `[[dbprefix]]rating_entity` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COMMENT='Ratings';

--
-- Dumping data for table `[[dbprefix]]rating`
--

INSERT INTO `[[dbprefix]]rating` VALUES (1,1,'Quality',0,1),(2,1,'Value',0,1),(3,1,'Price',0,1);

--
-- Table structure for table `[[dbprefix]]rating_entity`
--

CREATE TABLE `[[dbprefix]]rating_entity` (
  `entity_id` smallint unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `entity_code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Entity Code',
  PRIMARY KEY (`entity_id`),
  UNIQUE KEY `[[DBPREFIX]]RATING_ENTITY_ENTITY_CODE` (`entity_code`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COMMENT='Rating entities';

--
-- Dumping data for table `[[dbprefix]]rating_entity`
--

INSERT INTO `[[dbprefix]]rating_entity` VALUES (1,'product'),(2,'product_review'),(3,'review');

--
-- Table structure for table `[[dbprefix]]rating_option`
--

CREATE TABLE `[[dbprefix]]rating_option` (
  `option_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Rating Option ID',
  `rating_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Rating ID',
  `code` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Rating Option Code',
  `value` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Rating Option Value',
  `position` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Ration option position on Storefront',
  PRIMARY KEY (`option_id`),
  KEY `[[DBPREFIX]]RATING_OPTION_RATING_ID` (`rating_id`),
  CONSTRAINT `[[DBPREFIX]]RATING_OPTION_RATING_ID_[[DBPREFIX]]RATING_RATING_ID` FOREIGN KEY (`rating_id`) REFERENCES `[[dbprefix]]rating` (`rating_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COMMENT='Rating options';

--
-- Dumping data for table `[[dbprefix]]rating_option`
--

INSERT INTO `[[dbprefix]]rating_option` VALUES (1,1,'1',1,1),(2,1,'2',2,2),(3,1,'3',3,3),(4,1,'4',4,4),(5,1,'5',5,5),(6,2,'1',1,1),(7,2,'2',2,2),(8,2,'3',3,3),(9,2,'4',4,4),(10,2,'5',5,5),(11,3,'1',1,1),(12,3,'2',2,2),(13,3,'3',3,3),(14,3,'4',4,4),(15,3,'5',5,5);

--
-- Table structure for table `[[dbprefix]]rating_option_vote`
--

CREATE TABLE `[[dbprefix]]rating_option_vote` (
  `vote_id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'Vote ID',
  `option_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Vote option ID',
  `remote_ip` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Customer IP',
  `remote_ip_long` bigint NOT NULL DEFAULT '0' COMMENT 'Customer IP converted to long integer format',
  `customer_id` int unsigned DEFAULT '0' COMMENT 'Customer ID',
  `entity_pk_value` bigint unsigned NOT NULL DEFAULT '0' COMMENT 'Product ID',
  `rating_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Rating ID',
  `review_id` bigint unsigned DEFAULT NULL COMMENT 'Review ID',
  `percent` smallint NOT NULL DEFAULT '0' COMMENT 'Percent amount',
  `value` smallint NOT NULL DEFAULT '0' COMMENT 'Vote option value',
  PRIMARY KEY (`vote_id`),
  KEY `[[DBPREFIX]]RATING_OPTION_VOTE_REVIEW_ID_[[DBPREFIX]]REVIEW_REVIEW_ID` (`review_id`),
  KEY `[[DBPREFIX]]RATING_OPTION_VOTE_OPTION_ID` (`option_id`),
  CONSTRAINT `[[DBPREFIX]]RATING_OPTION_VOTE_OPTION_ID_[[DBPREFIX]]RATING_OPTION_OPTION_ID` FOREIGN KEY (`option_id`) REFERENCES `[[dbprefix]]rating_option` (`option_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]RATING_OPTION_VOTE_REVIEW_ID_[[DBPREFIX]]REVIEW_REVIEW_ID` FOREIGN KEY (`review_id`) REFERENCES `[[dbprefix]]review` (`review_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Rating option values';

--
-- Dumping data for table `[[dbprefix]]rating_option_vote`
--


--
-- Table structure for table `[[dbprefix]]rating_option_vote_aggregated`
--

CREATE TABLE `[[dbprefix]]rating_option_vote_aggregated` (
  `primary_id` int NOT NULL AUTO_INCREMENT COMMENT 'Vote aggregation ID',
  `rating_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Rating ID',
  `entity_pk_value` bigint unsigned NOT NULL DEFAULT '0' COMMENT 'Product ID',
  `vote_count` int unsigned NOT NULL DEFAULT '0' COMMENT 'Vote dty',
  `vote_value_sum` int unsigned NOT NULL DEFAULT '0' COMMENT 'General vote sum',
  `percent` smallint NOT NULL DEFAULT '0' COMMENT 'Vote percent',
  `percent_approved` smallint DEFAULT '0' COMMENT 'Vote percent approved by admin',
  `store_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Store ID',
  PRIMARY KEY (`primary_id`),
  KEY `[[DBPREFIX]]RATING_OPTION_VOTE_AGGREGATED_RATING_ID` (`rating_id`),
  KEY `[[DBPREFIX]]RATING_OPTION_VOTE_AGGREGATED_STORE_ID` (`store_id`),
  CONSTRAINT `[[DBPREFIX]]RATING_OPT_VOTE_AGGRED_RATING_ID_[[DBPREFIX]]RATING_RATING_ID` FOREIGN KEY (`rating_id`) REFERENCES `[[dbprefix]]rating` (`rating_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]RATING_OPTION_VOTE_AGGREGATED_STORE_ID_[[DBPREFIX]]STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Rating vote aggregated';

--
-- Dumping data for table `[[dbprefix]]rating_option_vote_aggregated`
--


--
-- Table structure for table `[[dbprefix]]rating_store`
--

CREATE TABLE `[[dbprefix]]rating_store` (
  `rating_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Rating ID',
  `store_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Store ID',
  PRIMARY KEY (`rating_id`,`store_id`),
  KEY `[[DBPREFIX]]RATING_STORE_STORE_ID` (`store_id`),
  CONSTRAINT `[[DBPREFIX]]RATING_STORE_RATING_ID_[[DBPREFIX]]RATING_RATING_ID` FOREIGN KEY (`rating_id`) REFERENCES `[[dbprefix]]rating` (`rating_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]RATING_STORE_STORE_ID_[[DBPREFIX]]STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Rating Store';

--
-- Dumping data for table `[[dbprefix]]rating_store`
--


--
-- Table structure for table `[[dbprefix]]rating_title`
--

CREATE TABLE `[[dbprefix]]rating_title` (
  `rating_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Rating ID',
  `store_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Store ID',
  `value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Rating Label',
  PRIMARY KEY (`rating_id`,`store_id`),
  KEY `[[DBPREFIX]]RATING_TITLE_STORE_ID` (`store_id`),
  CONSTRAINT `[[DBPREFIX]]RATING_TITLE_RATING_ID_[[DBPREFIX]]RATING_RATING_ID` FOREIGN KEY (`rating_id`) REFERENCES `[[dbprefix]]rating` (`rating_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]RATING_TITLE_STORE_ID_[[DBPREFIX]]STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Rating Title';

--
-- Dumping data for table `[[dbprefix]]rating_title`
--


--
-- Table structure for table `[[dbprefix]]release_notification_viewer_log`
--

CREATE TABLE `[[dbprefix]]release_notification_viewer_log` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Log ID',
  `viewer_id` int unsigned NOT NULL COMMENT 'Viewer admin user ID',
  `last_view_version` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Viewer last view on product version',
  PRIMARY KEY (`id`),
  UNIQUE KEY `[[DBPREFIX]]RELEASE_NOTIFICATION_VIEWER_LOG_VIEWER_ID` (`viewer_id`),
  CONSTRAINT `[[DBPREFIX]]RELEASE_NTFC_VIEWER_LOG_VIEWER_ID_[[DBPREFIX]]ADM_USR_USR_ID` FOREIGN KEY (`viewer_id`) REFERENCES `[[dbprefix]]admin_user` (`user_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Release Notification Viewer Log Table';

--
-- Dumping data for table `[[dbprefix]]release_notification_viewer_log`
--


--
-- Table structure for table `[[dbprefix]]report_compared_product_index`
--

CREATE TABLE `[[dbprefix]]report_compared_product_index` (
  `index_id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'Index ID',
  `visitor_id` int unsigned DEFAULT NULL COMMENT 'Visitor ID',
  `customer_id` int unsigned DEFAULT NULL COMMENT 'Customer ID',
  `product_id` int unsigned NOT NULL COMMENT 'Product ID',
  `store_id` smallint unsigned DEFAULT NULL COMMENT 'Store ID',
  `added_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Added At',
  PRIMARY KEY (`index_id`),
  UNIQUE KEY `[[DBPREFIX]]REPORT_COMPARED_PRODUCT_INDEX_VISITOR_ID_PRODUCT_ID` (`visitor_id`,`product_id`),
  UNIQUE KEY `[[DBPREFIX]]REPORT_COMPARED_PRODUCT_INDEX_CUSTOMER_ID_PRODUCT_ID` (`customer_id`,`product_id`),
  KEY `[[DBPREFIX]]REPORT_COMPARED_PRODUCT_INDEX_STORE_ID` (`store_id`),
  KEY `[[DBPREFIX]]REPORT_COMPARED_PRODUCT_INDEX_ADDED_AT` (`added_at`),
  KEY `[[DBPREFIX]]REPORT_COMPARED_PRODUCT_INDEX_PRODUCT_ID` (`product_id`),
  CONSTRAINT `[[DBPREFIX]]REPORT_CMPD_PRD_IDX_CSTR_ID_[[DBPREFIX]]CSTR_ENTT_ENTT_ID` FOREIGN KEY (`customer_id`) REFERENCES `[[dbprefix]]customer_entity` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]REPORT_CMPD_PRD_IDX_PRD_ID_[[DBPREFIX]]CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `[[dbprefix]]catalog_product_entity` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]REPORT_COMPARED_PRODUCT_INDEX_STORE_ID_[[DBPREFIX]]STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Reports Compared Product Index Table';

--
-- Dumping data for table `[[dbprefix]]report_compared_product_index`
--


--
-- Table structure for table `[[dbprefix]]report_event`
--

CREATE TABLE `[[dbprefix]]report_event` (
  `event_id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'Event ID',
  `logged_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Logged At',
  `event_type_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Event Type ID',
  `object_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Object ID',
  `subject_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Subject ID',
  `subtype` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Subtype',
  `store_id` smallint unsigned NOT NULL COMMENT 'Store ID',
  PRIMARY KEY (`event_id`),
  KEY `[[DBPREFIX]]REPORT_EVENT_EVENT_TYPE_ID` (`event_type_id`),
  KEY `[[DBPREFIX]]REPORT_EVENT_SUBJECT_ID` (`subject_id`),
  KEY `[[DBPREFIX]]REPORT_EVENT_OBJECT_ID` (`object_id`),
  KEY `[[DBPREFIX]]REPORT_EVENT_SUBTYPE` (`subtype`),
  KEY `[[DBPREFIX]]REPORT_EVENT_STORE_ID` (`store_id`),
  CONSTRAINT `FK_1E9A364859CCE03F3DD9ACF825D18BF6` FOREIGN KEY (`event_type_id`) REFERENCES `[[dbprefix]]report_event_types` (`event_type_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]REPORT_EVENT_STORE_ID_[[DBPREFIX]]STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Reports Event Table';

--
-- Dumping data for table `[[dbprefix]]report_event`
--


--
-- Table structure for table `[[dbprefix]]report_event_types`
--

CREATE TABLE `[[dbprefix]]report_event_types` (
  `event_type_id` smallint unsigned NOT NULL AUTO_INCREMENT COMMENT 'Event Type ID',
  `event_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Event Name',
  `customer_login` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Customer Login',
  PRIMARY KEY (`event_type_id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COMMENT='Reports Event Type Table';

--
-- Dumping data for table `[[dbprefix]]report_event_types`
--

INSERT INTO `[[dbprefix]]report_event_types` VALUES (1,'catalog_product_view',0),(2,'sendfriend_product',0),(3,'catalog_product_compare_add_product',0),(4,'checkout_cart_add_product',0),(5,'wishlist_add_product',0),(6,'wishlist_share',0);

--
-- Table structure for table `[[dbprefix]]report_viewed_product_aggregated_daily`
--

CREATE TABLE `[[dbprefix]]report_viewed_product_aggregated_daily` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `period` date DEFAULT NULL COMMENT 'Period',
  `store_id` smallint unsigned DEFAULT NULL COMMENT 'Store ID',
  `product_id` int unsigned DEFAULT NULL COMMENT 'Product ID',
  `product_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Product Name',
  `product_price` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Product Price',
  `views_num` int NOT NULL DEFAULT '0' COMMENT 'Number of Views',
  `rating_pos` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Rating Pos',
  PRIMARY KEY (`id`),
  UNIQUE KEY `[[DBPREFIX]]REPORT_VIEWED_PRD_AGGRED_DAILY_PERIOD_STORE_ID_PRD_ID` (`period`,`store_id`,`product_id`),
  KEY `[[DBPREFIX]]REPORT_VIEWED_PRODUCT_AGGREGATED_DAILY_STORE_ID` (`store_id`),
  KEY `[[DBPREFIX]]REPORT_VIEWED_PRODUCT_AGGREGATED_DAILY_PRODUCT_ID` (`product_id`),
  CONSTRAINT `FK_E27C3B52E1A2D5E4845EB01EF11F49B2` FOREIGN KEY (`product_id`) REFERENCES `[[dbprefix]]catalog_product_entity` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]REPORT_VIEWED_PRD_AGGRED_DAILY_STORE_ID_[[DBPREFIX]]STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Most Viewed Products Aggregated Daily';

--
-- Dumping data for table `[[dbprefix]]report_viewed_product_aggregated_daily`
--


--
-- Table structure for table `[[dbprefix]]report_viewed_product_aggregated_monthly`
--

CREATE TABLE `[[dbprefix]]report_viewed_product_aggregated_monthly` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `period` date DEFAULT NULL COMMENT 'Period',
  `store_id` smallint unsigned DEFAULT NULL COMMENT 'Store ID',
  `product_id` int unsigned DEFAULT NULL COMMENT 'Product ID',
  `product_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Product Name',
  `product_price` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Product Price',
  `views_num` int NOT NULL DEFAULT '0' COMMENT 'Number of Views',
  `rating_pos` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Rating Pos',
  PRIMARY KEY (`id`),
  UNIQUE KEY `[[DBPREFIX]]REPORT_VIEWED_PRD_AGGRED_MONTHLY_PERIOD_STORE_ID_PRD_ID` (`period`,`store_id`,`product_id`),
  KEY `[[DBPREFIX]]REPORT_VIEWED_PRODUCT_AGGREGATED_MONTHLY_STORE_ID` (`store_id`),
  KEY `[[DBPREFIX]]REPORT_VIEWED_PRODUCT_AGGREGATED_MONTHLY_PRODUCT_ID` (`product_id`),
  CONSTRAINT `FK_B76260026D9FE9E45230A731A9860BA7` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE CASCADE,
  CONSTRAINT `FK_D5C3C380933099BF6DBA36FC13AA307B` FOREIGN KEY (`product_id`) REFERENCES `[[dbprefix]]catalog_product_entity` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Most Viewed Products Aggregated Monthly';

--
-- Dumping data for table `[[dbprefix]]report_viewed_product_aggregated_monthly`
--


--
-- Table structure for table `[[dbprefix]]report_viewed_product_aggregated_yearly`
--

CREATE TABLE `[[dbprefix]]report_viewed_product_aggregated_yearly` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `period` date DEFAULT NULL COMMENT 'Period',
  `store_id` smallint unsigned DEFAULT NULL COMMENT 'Store ID',
  `product_id` int unsigned DEFAULT NULL COMMENT 'Product ID',
  `product_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Product Name',
  `product_price` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Product Price',
  `views_num` int NOT NULL DEFAULT '0' COMMENT 'Number of Views',
  `rating_pos` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Rating Pos',
  PRIMARY KEY (`id`),
  UNIQUE KEY `[[DBPREFIX]]REPORT_VIEWED_PRD_AGGRED_YEARLY_PERIOD_STORE_ID_PRD_ID` (`period`,`store_id`,`product_id`),
  KEY `[[DBPREFIX]]REPORT_VIEWED_PRODUCT_AGGREGATED_YEARLY_STORE_ID` (`store_id`),
  KEY `[[DBPREFIX]]REPORT_VIEWED_PRODUCT_AGGREGATED_YEARLY_PRODUCT_ID` (`product_id`),
  CONSTRAINT `FK_6599AF5F11E05C842A7B226C6C7F3377` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE CASCADE,
  CONSTRAINT `FK_D9D14244DB9E38A4F72DE0072D998249` FOREIGN KEY (`product_id`) REFERENCES `[[dbprefix]]catalog_product_entity` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Most Viewed Products Aggregated Yearly';

--
-- Dumping data for table `[[dbprefix]]report_viewed_product_aggregated_yearly`
--


--
-- Table structure for table `[[dbprefix]]report_viewed_product_index`
--

CREATE TABLE `[[dbprefix]]report_viewed_product_index` (
  `index_id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'Index ID',
  `visitor_id` int unsigned DEFAULT NULL COMMENT 'Visitor ID',
  `customer_id` int unsigned DEFAULT NULL COMMENT 'Customer ID',
  `product_id` int unsigned NOT NULL COMMENT 'Product ID',
  `store_id` smallint unsigned DEFAULT NULL COMMENT 'Store ID',
  `added_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Added At',
  PRIMARY KEY (`index_id`),
  UNIQUE KEY `[[DBPREFIX]]REPORT_VIEWED_PRODUCT_INDEX_VISITOR_ID_PRODUCT_ID` (`visitor_id`,`product_id`),
  UNIQUE KEY `[[DBPREFIX]]REPORT_VIEWED_PRODUCT_INDEX_CUSTOMER_ID_PRODUCT_ID` (`customer_id`,`product_id`),
  KEY `[[DBPREFIX]]REPORT_VIEWED_PRODUCT_INDEX_STORE_ID` (`store_id`),
  KEY `[[DBPREFIX]]REPORT_VIEWED_PRODUCT_INDEX_ADDED_AT` (`added_at`),
  KEY `[[DBPREFIX]]REPORT_VIEWED_PRODUCT_INDEX_PRODUCT_ID` (`product_id`),
  CONSTRAINT `[[DBPREFIX]]REPORT_VIEWED_PRD_IDX_CSTR_ID_[[DBPREFIX]]CSTR_ENTT_ENTT_ID` FOREIGN KEY (`customer_id`) REFERENCES `[[dbprefix]]customer_entity` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]REPORT_VIEWED_PRD_IDX_PRD_ID_[[DBPREFIX]]CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `[[dbprefix]]catalog_product_entity` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]REPORT_VIEWED_PRODUCT_INDEX_STORE_ID_[[DBPREFIX]]STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Reports Viewed Product Index Table';

--
-- Dumping data for table `[[dbprefix]]report_viewed_product_index`
--


--
-- Table structure for table `[[dbprefix]]reporting_counts`
--

CREATE TABLE `[[dbprefix]]reporting_counts` (
  `entity_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Item Reported',
  `count` int unsigned DEFAULT NULL COMMENT 'Count Value',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Updated At',
  PRIMARY KEY (`entity_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Reporting for all count related events generated via the cron job';

--
-- Dumping data for table `[[dbprefix]]reporting_counts`
--


--
-- Table structure for table `[[dbprefix]]reporting_module_status`
--

CREATE TABLE `[[dbprefix]]reporting_module_status` (
  `entity_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Module ID',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Module Name',
  `active` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Module Active Status',
  `setup_version` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Module Version',
  `state` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Module State',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Updated At',
  PRIMARY KEY (`entity_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Module Status Table';

--
-- Dumping data for table `[[dbprefix]]reporting_module_status`
--


--
-- Table structure for table `[[dbprefix]]reporting_orders`
--

CREATE TABLE `[[dbprefix]]reporting_orders` (
  `entity_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `customer_id` int unsigned DEFAULT NULL COMMENT 'Customer ID',
  `total` decimal(20,4) unsigned DEFAULT NULL,
  `total_base` decimal(20,4) unsigned DEFAULT NULL,
  `item_count` int unsigned NOT NULL COMMENT 'Line Item Count',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Updated At',
  PRIMARY KEY (`entity_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Reporting for all orders';

--
-- Dumping data for table `[[dbprefix]]reporting_orders`
--


--
-- Table structure for table `[[dbprefix]]reporting_system_updates`
--

CREATE TABLE `[[dbprefix]]reporting_system_updates` (
  `entity_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Update Type',
  `action` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Action Performed',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Updated At',
  PRIMARY KEY (`entity_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Reporting for system updates';

--
-- Dumping data for table `[[dbprefix]]reporting_system_updates`
--


--
-- Table structure for table `[[dbprefix]]reporting_users`
--

CREATE TABLE `[[dbprefix]]reporting_users` (
  `entity_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'User Type',
  `action` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Action Performed',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Updated At',
  PRIMARY KEY (`entity_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Reporting for user actions';

--
-- Dumping data for table `[[dbprefix]]reporting_users`
--


--
-- Table structure for table `[[dbprefix]]review`
--

CREATE TABLE `[[dbprefix]]review` (
  `review_id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'Review ID',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Review create date',
  `entity_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Entity ID',
  `entity_pk_value` int unsigned NOT NULL DEFAULT '0' COMMENT 'Product ID',
  `status_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Status code',
  PRIMARY KEY (`review_id`),
  KEY `[[DBPREFIX]]REVIEW_ENTITY_ID` (`entity_id`),
  KEY `[[DBPREFIX]]REVIEW_STATUS_ID` (`status_id`),
  KEY `[[DBPREFIX]]REVIEW_ENTITY_PK_VALUE` (`entity_pk_value`),
  CONSTRAINT `[[DBPREFIX]]REVIEW_ENTITY_ID_[[DBPREFIX]]REVIEW_ENTITY_ENTITY_ID` FOREIGN KEY (`entity_id`) REFERENCES `[[dbprefix]]review_entity` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]REVIEW_STATUS_ID_[[DBPREFIX]]REVIEW_STATUS_STATUS_ID` FOREIGN KEY (`status_id`) REFERENCES `[[dbprefix]]review_status` (`status_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Review base information';

--
-- Dumping data for table `[[dbprefix]]review`
--


--
-- Table structure for table `[[dbprefix]]review_detail`
--

CREATE TABLE `[[dbprefix]]review_detail` (
  `detail_id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'Review detail ID',
  `review_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT 'Review ID',
  `store_id` smallint unsigned DEFAULT '0' COMMENT 'Store ID',
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Title',
  `detail` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Detail description',
  `nickname` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'User nickname',
  `customer_id` int unsigned DEFAULT NULL COMMENT 'Customer ID',
  PRIMARY KEY (`detail_id`),
  KEY `[[DBPREFIX]]REVIEW_DETAIL_REVIEW_ID` (`review_id`),
  KEY `[[DBPREFIX]]REVIEW_DETAIL_STORE_ID` (`store_id`),
  KEY `[[DBPREFIX]]REVIEW_DETAIL_CUSTOMER_ID` (`customer_id`),
  CONSTRAINT `[[DBPREFIX]]REVIEW_DETAIL_CUSTOMER_ID_[[DBPREFIX]]CUSTOMER_ENTITY_ENTITY_ID` FOREIGN KEY (`customer_id`) REFERENCES `[[dbprefix]]customer_entity` (`entity_id`) ON DELETE SET NULL,
  CONSTRAINT `[[DBPREFIX]]REVIEW_DETAIL_REVIEW_ID_[[DBPREFIX]]REVIEW_REVIEW_ID` FOREIGN KEY (`review_id`) REFERENCES `[[dbprefix]]review` (`review_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]REVIEW_DETAIL_STORE_ID_[[DBPREFIX]]STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Review detail information';

--
-- Dumping data for table `[[dbprefix]]review_detail`
--


--
-- Table structure for table `[[dbprefix]]review_entity`
--

CREATE TABLE `[[dbprefix]]review_entity` (
  `entity_id` smallint unsigned NOT NULL AUTO_INCREMENT COMMENT 'Review entity ID',
  `entity_code` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Review entity code',
  PRIMARY KEY (`entity_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COMMENT='Review entities';

--
-- Dumping data for table `[[dbprefix]]review_entity`
--

INSERT INTO `[[dbprefix]]review_entity` VALUES (1,'product'),(2,'customer'),(3,'category');

--
-- Table structure for table `[[dbprefix]]review_entity_summary`
--

CREATE TABLE `[[dbprefix]]review_entity_summary` (
  `primary_id` bigint NOT NULL AUTO_INCREMENT COMMENT 'Summary review entity ID',
  `entity_pk_value` bigint NOT NULL DEFAULT '0' COMMENT 'Product ID',
  `entity_type` smallint NOT NULL DEFAULT '0' COMMENT 'Entity type ID',
  `reviews_count` smallint NOT NULL DEFAULT '0' COMMENT 'Qty of reviews',
  `rating_summary` smallint NOT NULL DEFAULT '0' COMMENT 'Summarized rating',
  `store_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Store ID',
  PRIMARY KEY (`primary_id`),
  UNIQUE KEY `[[DBPREFIX]]REVIEW_ENTITY_SUMMARY_ENTITY_PK_VALUE_STORE_ID_ENTITY_TYPE` (`entity_pk_value`,`store_id`,`entity_type`),
  KEY `[[DBPREFIX]]REVIEW_ENTITY_SUMMARY_STORE_ID` (`store_id`),
  CONSTRAINT `[[DBPREFIX]]REVIEW_ENTITY_SUMMARY_STORE_ID_[[DBPREFIX]]STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Review aggregates';

--
-- Dumping data for table `[[dbprefix]]review_entity_summary`
--


--
-- Table structure for table `[[dbprefix]]review_status`
--

CREATE TABLE `[[dbprefix]]review_status` (
  `status_id` smallint unsigned NOT NULL AUTO_INCREMENT COMMENT 'Status ID',
  `status_code` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Status code',
  PRIMARY KEY (`status_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COMMENT='Review statuses';

--
-- Dumping data for table `[[dbprefix]]review_status`
--

INSERT INTO `[[dbprefix]]review_status` VALUES (1,'Approved'),(2,'Pending'),(3,'Not Approved');

--
-- Table structure for table `[[dbprefix]]review_store`
--

CREATE TABLE `[[dbprefix]]review_store` (
  `review_id` bigint unsigned NOT NULL COMMENT 'Review ID',
  `store_id` smallint unsigned NOT NULL COMMENT 'Store ID',
  PRIMARY KEY (`review_id`,`store_id`),
  KEY `[[DBPREFIX]]REVIEW_STORE_STORE_ID` (`store_id`),
  CONSTRAINT `[[DBPREFIX]]REVIEW_STORE_REVIEW_ID_[[DBPREFIX]]REVIEW_REVIEW_ID` FOREIGN KEY (`review_id`) REFERENCES `[[dbprefix]]review` (`review_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]REVIEW_STORE_STORE_ID_[[DBPREFIX]]STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Review Store';

--
-- Dumping data for table `[[dbprefix]]review_store`
--


--
-- Table structure for table `[[dbprefix]]sales_bestsellers_aggregated_daily`
--

CREATE TABLE `[[dbprefix]]sales_bestsellers_aggregated_daily` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `period` date DEFAULT NULL COMMENT 'Period',
  `store_id` smallint unsigned DEFAULT NULL COMMENT 'Store ID',
  `product_id` int unsigned DEFAULT NULL COMMENT 'Product ID',
  `product_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Product Name',
  `product_price` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Product Price',
  `qty_ordered` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Qty Ordered',
  `rating_pos` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Rating Pos',
  PRIMARY KEY (`id`),
  UNIQUE KEY `[[DBPREFIX]]SALES_BESTSELLERS_AGGRED_DAILY_PERIOD_STORE_ID_PRD_ID` (`period`,`store_id`,`product_id`),
  KEY `[[DBPREFIX]]SALES_BESTSELLERS_AGGREGATED_DAILY_STORE_ID` (`store_id`),
  KEY `[[DBPREFIX]]SALES_BESTSELLERS_AGGREGATED_DAILY_PRODUCT_ID` (`product_id`),
  CONSTRAINT `[[DBPREFIX]]SALES_BESTSELLERS_AGGRED_DAILY_STORE_ID_[[DBPREFIX]]STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Bestsellers Aggregated Daily';

--
-- Dumping data for table `[[dbprefix]]sales_bestsellers_aggregated_daily`
--


--
-- Table structure for table `[[dbprefix]]sales_bestsellers_aggregated_monthly`
--

CREATE TABLE `[[dbprefix]]sales_bestsellers_aggregated_monthly` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `period` date DEFAULT NULL COMMENT 'Period',
  `store_id` smallint unsigned DEFAULT NULL COMMENT 'Store ID',
  `product_id` int unsigned DEFAULT NULL COMMENT 'Product ID',
  `product_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Product Name',
  `product_price` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Product Price',
  `qty_ordered` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Qty Ordered',
  `rating_pos` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Rating Pos',
  PRIMARY KEY (`id`),
  UNIQUE KEY `[[DBPREFIX]]SALES_BESTSELLERS_AGGRED_MONTHLY_PERIOD_STORE_ID_PRD_ID` (`period`,`store_id`,`product_id`),
  KEY `[[DBPREFIX]]SALES_BESTSELLERS_AGGREGATED_MONTHLY_STORE_ID` (`store_id`),
  KEY `[[DBPREFIX]]SALES_BESTSELLERS_AGGREGATED_MONTHLY_PRODUCT_ID` (`product_id`),
  CONSTRAINT `FK_917F1D21C8B65498447CACB6C2C45EC5` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Bestsellers Aggregated Monthly';

--
-- Dumping data for table `[[dbprefix]]sales_bestsellers_aggregated_monthly`
--


--
-- Table structure for table `[[dbprefix]]sales_bestsellers_aggregated_yearly`
--

CREATE TABLE `[[dbprefix]]sales_bestsellers_aggregated_yearly` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `period` date DEFAULT NULL COMMENT 'Period',
  `store_id` smallint unsigned DEFAULT NULL COMMENT 'Store ID',
  `product_id` int unsigned DEFAULT NULL COMMENT 'Product ID',
  `product_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Product Name',
  `product_price` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Product Price',
  `qty_ordered` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Qty Ordered',
  `rating_pos` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Rating Pos',
  PRIMARY KEY (`id`),
  UNIQUE KEY `[[DBPREFIX]]SALES_BESTSELLERS_AGGRED_YEARLY_PERIOD_STORE_ID_PRD_ID` (`period`,`store_id`,`product_id`),
  KEY `[[DBPREFIX]]SALES_BESTSELLERS_AGGREGATED_YEARLY_STORE_ID` (`store_id`),
  KEY `[[DBPREFIX]]SALES_BESTSELLERS_AGGREGATED_YEARLY_PRODUCT_ID` (`product_id`),
  CONSTRAINT `FK_C2B58A114880F6D0AF2DE1C5DADF9AF1` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Bestsellers Aggregated Yearly';

--
-- Dumping data for table `[[dbprefix]]sales_bestsellers_aggregated_yearly`
--


--
-- Table structure for table `[[dbprefix]]sales_creditmemo`
--

CREATE TABLE `[[dbprefix]]sales_creditmemo` (
  `entity_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `store_id` smallint unsigned DEFAULT NULL COMMENT 'Store ID',
  `adjustment_positive` decimal(20,4) DEFAULT NULL COMMENT 'Adjustment Positive',
  `base_shipping_tax_amount` decimal(20,4) DEFAULT NULL COMMENT 'Base Shipping Tax Amount',
  `store_to_order_rate` decimal(20,4) DEFAULT NULL COMMENT 'Store To Order Rate',
  `base_discount_amount` decimal(20,4) DEFAULT NULL COMMENT 'Base Discount Amount',
  `base_to_order_rate` decimal(20,4) DEFAULT NULL COMMENT 'Base To Order Rate',
  `grand_total` decimal(20,4) DEFAULT NULL COMMENT 'Grand Total',
  `base_adjustment_negative` decimal(20,4) DEFAULT NULL COMMENT 'Base Adjustment Negative',
  `base_subtotal_incl_tax` decimal(20,4) DEFAULT NULL COMMENT 'Base Subtotal Incl Tax',
  `shipping_amount` decimal(20,4) DEFAULT NULL COMMENT 'Shipping Amount',
  `subtotal_incl_tax` decimal(20,4) DEFAULT NULL COMMENT 'Subtotal Incl Tax',
  `adjustment_negative` decimal(20,4) DEFAULT NULL COMMENT 'Adjustment Negative',
  `base_shipping_amount` decimal(20,4) DEFAULT NULL COMMENT 'Base Shipping Amount',
  `store_to_base_rate` decimal(20,4) DEFAULT NULL COMMENT 'Store To Base Rate',
  `base_to_global_rate` decimal(20,4) DEFAULT NULL COMMENT 'Base To Global Rate',
  `base_adjustment` decimal(20,4) DEFAULT NULL COMMENT 'Base Adjustment',
  `base_subtotal` decimal(20,4) DEFAULT NULL COMMENT 'Base Subtotal',
  `discount_amount` decimal(20,4) DEFAULT NULL COMMENT 'Discount Amount',
  `subtotal` decimal(20,4) DEFAULT NULL COMMENT 'Subtotal',
  `adjustment` decimal(20,4) DEFAULT NULL COMMENT 'Adjustment',
  `base_grand_total` decimal(20,4) DEFAULT NULL COMMENT 'Base Grand Total',
  `base_adjustment_positive` decimal(20,4) DEFAULT NULL COMMENT 'Base Adjustment Positive',
  `base_tax_amount` decimal(20,4) DEFAULT NULL COMMENT 'Base Tax Amount',
  `shipping_tax_amount` decimal(20,4) DEFAULT NULL COMMENT 'Shipping Tax Amount',
  `tax_amount` decimal(20,4) DEFAULT NULL COMMENT 'Tax Amount',
  `order_id` int unsigned NOT NULL COMMENT 'Order ID',
  `email_sent` smallint DEFAULT NULL COMMENT 'Email Sent',
  `send_email` smallint unsigned DEFAULT NULL COMMENT 'Send Email',
  `creditmemo_status` int DEFAULT NULL COMMENT 'Creditmemo Status',
  `state` int DEFAULT NULL COMMENT 'State',
  `shipping_address_id` int DEFAULT NULL COMMENT 'Shipping Address ID',
  `billing_address_id` int DEFAULT NULL COMMENT 'Billing Address ID',
  `invoice_id` int DEFAULT NULL COMMENT 'Invoice ID',
  `store_currency_code` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Store Currency Code',
  `order_currency_code` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Order Currency Code',
  `base_currency_code` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Base Currency Code',
  `global_currency_code` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Global Currency Code',
  `transaction_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Transaction ID',
  `increment_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Increment ID',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Created At',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Updated At',
  `discount_tax_compensation_amount` decimal(20,4) DEFAULT NULL COMMENT 'Discount Tax Compensation Amount',
  `base_discount_tax_compensation_amount` decimal(20,4) DEFAULT NULL COMMENT 'Base Discount Tax Compensation Amount',
  `shipping_discount_tax_compensation_amount` decimal(20,4) DEFAULT NULL COMMENT 'Shipping Discount Tax Compensation Amount',
  `base_shipping_discount_tax_compensation_amnt` decimal(20,4) DEFAULT NULL COMMENT 'Base Shipping Discount Tax Compensation Amount',
  `shipping_incl_tax` decimal(20,4) DEFAULT NULL COMMENT 'Shipping Incl Tax',
  `base_shipping_incl_tax` decimal(20,4) DEFAULT NULL COMMENT 'Base Shipping Incl Tax',
  `discount_description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Discount Description',
  `customer_note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Customer Note',
  `customer_note_notify` smallint unsigned DEFAULT NULL COMMENT 'Customer Note Notify',
  PRIMARY KEY (`entity_id`),
  UNIQUE KEY `[[DBPREFIX]]SALES_CREDITMEMO_INCREMENT_ID_STORE_ID` (`increment_id`,`store_id`),
  KEY `[[DBPREFIX]]SALES_CREDITMEMO_STORE_ID` (`store_id`),
  KEY `[[DBPREFIX]]SALES_CREDITMEMO_ORDER_ID` (`order_id`),
  KEY `[[DBPREFIX]]SALES_CREDITMEMO_CREDITMEMO_STATUS` (`creditmemo_status`),
  KEY `[[DBPREFIX]]SALES_CREDITMEMO_STATE` (`state`),
  KEY `[[DBPREFIX]]SALES_CREDITMEMO_CREATED_AT` (`created_at`),
  KEY `[[DBPREFIX]]SALES_CREDITMEMO_UPDATED_AT` (`updated_at`),
  KEY `[[DBPREFIX]]SALES_CREDITMEMO_SEND_EMAIL` (`send_email`),
  KEY `[[DBPREFIX]]SALES_CREDITMEMO_EMAIL_SENT` (`email_sent`),
  CONSTRAINT `[[DBPREFIX]]SALES_CREDITMEMO_ORDER_ID_[[DBPREFIX]]SALES_ORDER_ENTITY_ID` FOREIGN KEY (`order_id`) REFERENCES `[[dbprefix]]sales_order` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]SALES_CREDITMEMO_STORE_ID_[[DBPREFIX]]STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Flat Creditmemo';

--
-- Dumping data for table `[[dbprefix]]sales_creditmemo`
--


--
-- Table structure for table `[[dbprefix]]sales_creditmemo_comment`
--

CREATE TABLE `[[dbprefix]]sales_creditmemo_comment` (
  `entity_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `parent_id` int unsigned NOT NULL COMMENT 'Parent ID',
  `is_customer_notified` int DEFAULT NULL COMMENT 'Is Customer Notified',
  `is_visible_on_front` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Is Visible On Front',
  `comment` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Comment',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Created At',
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Updated At',
  `user_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Admin User ID',
  `user_type` int unsigned NOT NULL DEFAULT '0' COMMENT 'User Type',
  PRIMARY KEY (`entity_id`),
  UNIQUE KEY `[[DBPREFIX]]SALES_CREDITMEMO_COMMENT_ENTITY_ID_USER_ID_USER_TYPE` (`entity_id`,`user_id`,`user_type`),
  KEY `[[DBPREFIX]]SALES_CREDITMEMO_COMMENT_CREATED_AT` (`created_at`),
  KEY `[[DBPREFIX]]SALES_CREDITMEMO_COMMENT_PARENT_ID` (`parent_id`),
  CONSTRAINT `FK_5387631F2834DD79690F101F14F382AF` FOREIGN KEY (`parent_id`) REFERENCES `[[dbprefix]]sales_creditmemo` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Flat Creditmemo Comment';

--
-- Dumping data for table `[[dbprefix]]sales_creditmemo_comment`
--


--
-- Table structure for table `[[dbprefix]]sales_creditmemo_grid`
--

CREATE TABLE `[[dbprefix]]sales_creditmemo_grid` (
  `entity_id` int unsigned NOT NULL COMMENT 'Entity ID',
  `increment_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Increment ID',
  `created_at` timestamp NULL DEFAULT NULL COMMENT 'Created At',
  `updated_at` timestamp NULL DEFAULT NULL COMMENT 'Updated At',
  `order_id` int unsigned NOT NULL COMMENT 'Order ID',
  `order_increment_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Order Increment ID',
  `order_created_at` timestamp NULL DEFAULT NULL COMMENT 'Order Created At',
  `billing_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Billing Name',
  `state` int DEFAULT NULL COMMENT 'Status',
  `base_grand_total` decimal(20,4) DEFAULT NULL COMMENT 'Base Grand Total',
  `order_status` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Order Status',
  `store_id` smallint unsigned DEFAULT NULL COMMENT 'Store ID',
  `billing_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Billing Address',
  `shipping_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Shipping Address',
  `customer_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Customer Name',
  `customer_email` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Customer Email',
  `customer_group_id` smallint DEFAULT NULL COMMENT 'Customer Group ID',
  `payment_method` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Payment Method',
  `shipping_information` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Shipping Method Name',
  `subtotal` decimal(20,4) DEFAULT NULL COMMENT 'Subtotal',
  `shipping_and_handling` decimal(20,4) DEFAULT NULL COMMENT 'Shipping and handling amount',
  `adjustment_positive` decimal(20,4) DEFAULT NULL COMMENT 'Adjustment Positive',
  `adjustment_negative` decimal(20,4) DEFAULT NULL COMMENT 'Adjustment Negative',
  `order_base_grand_total` decimal(20,4) DEFAULT NULL COMMENT 'Order Grand Total',
  PRIMARY KEY (`entity_id`),
  UNIQUE KEY `[[DBPREFIX]]SALES_CREDITMEMO_GRID_INCREMENT_ID_STORE_ID` (`increment_id`,`store_id`),
  KEY `[[DBPREFIX]]SALES_CREDITMEMO_GRID_ORDER_INCREMENT_ID` (`order_increment_id`),
  KEY `[[DBPREFIX]]SALES_CREDITMEMO_GRID_CREATED_AT` (`created_at`),
  KEY `[[DBPREFIX]]SALES_CREDITMEMO_GRID_UPDATED_AT` (`updated_at`),
  KEY `[[DBPREFIX]]SALES_CREDITMEMO_GRID_ORDER_CREATED_AT` (`order_created_at`),
  KEY `[[DBPREFIX]]SALES_CREDITMEMO_GRID_STATE` (`state`),
  KEY `[[DBPREFIX]]SALES_CREDITMEMO_GRID_BILLING_NAME` (`billing_name`),
  KEY `[[DBPREFIX]]SALES_CREDITMEMO_GRID_ORDER_STATUS` (`order_status`),
  KEY `[[DBPREFIX]]SALES_CREDITMEMO_GRID_BASE_GRAND_TOTAL` (`base_grand_total`),
  KEY `[[DBPREFIX]]SALES_CREDITMEMO_GRID_STORE_ID` (`store_id`),
  KEY `[[DBPREFIX]]SALES_CREDITMEMO_GRID_ORDER_BASE_GRAND_TOTAL` (`order_base_grand_total`),
  KEY `[[DBPREFIX]]SALES_CREDITMEMO_GRID_ORDER_ID` (`order_id`),
  FULLTEXT KEY `FTI_9C333DEACC23DC368A7AFA455B8ED6D1` (`increment_id`,`order_increment_id`,`billing_name`,`billing_address`,`shipping_address`,`customer_name`,`customer_email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Flat Creditmemo Grid';

--
-- Dumping data for table `[[dbprefix]]sales_creditmemo_grid`
--


--
-- Table structure for table `[[dbprefix]]sales_creditmemo_item`
--

CREATE TABLE `[[dbprefix]]sales_creditmemo_item` (
  `entity_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `parent_id` int unsigned NOT NULL COMMENT 'Parent ID',
  `base_price` decimal(20,4) DEFAULT NULL COMMENT 'Base Price',
  `tax_amount` decimal(20,4) DEFAULT NULL COMMENT 'Tax Amount',
  `base_row_total` decimal(20,4) DEFAULT NULL COMMENT 'Base Row Total',
  `discount_amount` decimal(20,4) DEFAULT NULL COMMENT 'Discount Amount',
  `row_total` decimal(20,4) DEFAULT NULL COMMENT 'Row Total',
  `base_discount_amount` decimal(20,4) DEFAULT NULL COMMENT 'Base Discount Amount',
  `price_incl_tax` decimal(20,4) DEFAULT NULL COMMENT 'Price Incl Tax',
  `base_tax_amount` decimal(20,4) DEFAULT NULL COMMENT 'Base Tax Amount',
  `base_price_incl_tax` decimal(20,4) DEFAULT NULL COMMENT 'Base Price Incl Tax',
  `qty` decimal(12,4) DEFAULT NULL COMMENT 'Qty',
  `base_cost` decimal(20,4) DEFAULT NULL COMMENT 'Base Cost',
  `price` decimal(20,4) DEFAULT NULL COMMENT 'Price',
  `base_row_total_incl_tax` decimal(20,4) DEFAULT NULL COMMENT 'Base Row Total Incl Tax',
  `row_total_incl_tax` decimal(20,4) DEFAULT NULL COMMENT 'Row Total Incl Tax',
  `product_id` int DEFAULT NULL COMMENT 'Product ID',
  `order_item_id` int DEFAULT NULL COMMENT 'Order Item ID',
  `additional_data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Additional Data',
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Description',
  `sku` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Sku',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Name',
  `discount_tax_compensation_amount` decimal(20,4) DEFAULT NULL COMMENT 'Discount Tax Compensation Amount',
  `base_discount_tax_compensation_amount` decimal(20,4) DEFAULT NULL COMMENT 'Base Discount Tax Compensation Amount',
  `tax_ratio` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Ratio of tax in the creditmemo item over tax of the order item',
  `weee_tax_applied` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Weee Tax Applied',
  `weee_tax_applied_amount` decimal(12,4) DEFAULT NULL COMMENT 'Weee Tax Applied Amount',
  `weee_tax_applied_row_amount` decimal(12,4) DEFAULT NULL COMMENT 'Weee Tax Applied Row Amount',
  `weee_tax_disposition` decimal(12,4) DEFAULT NULL COMMENT 'Weee Tax Disposition',
  `weee_tax_row_disposition` decimal(12,4) DEFAULT NULL COMMENT 'Weee Tax Row Disposition',
  `base_weee_tax_applied_amount` decimal(12,4) DEFAULT NULL COMMENT 'Base Weee Tax Applied Amount',
  `base_weee_tax_applied_row_amnt` decimal(12,4) DEFAULT NULL COMMENT 'Base Weee Tax Applied Row Amnt',
  `base_weee_tax_disposition` decimal(12,4) DEFAULT NULL COMMENT 'Base Weee Tax Disposition',
  `base_weee_tax_row_disposition` decimal(12,4) DEFAULT NULL COMMENT 'Base Weee Tax Row Disposition',
  PRIMARY KEY (`entity_id`),
  KEY `[[DBPREFIX]]SALES_CREDITMEMO_ITEM_PARENT_ID` (`parent_id`),
  CONSTRAINT `FK_101F8955078B497273D57F534EA8BB34` FOREIGN KEY (`parent_id`) REFERENCES `[[dbprefix]]sales_creditmemo` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Flat Creditmemo Item';

--
-- Dumping data for table `[[dbprefix]]sales_creditmemo_item`
--


--
-- Table structure for table `[[dbprefix]]sales_data_exporter_order_statuses`
--

CREATE TABLE `[[dbprefix]]sales_data_exporter_order_statuses` (
  `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'status',
  `feed_data` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Feed Data',
  `modified_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Modified At',
  PRIMARY KEY (`status`),
  KEY `[[DBPREFIX]]SALES_DATA_EXPORTER_ORDER_STATUSES_MODIFIED_AT` (`modified_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Order Statuses Feed Storage';

--
-- Dumping data for table `[[dbprefix]]sales_data_exporter_order_statuses`
--

INSERT INTO `[[dbprefix]]sales_data_exporter_order_statuses` VALUES ('canceled','{\"status\":\"canceled\",\"label\":\"Canceled\"}','[[regtime]]'),('closed','{\"status\":\"closed\",\"label\":\"Closed\"}','[[regtime]]'),('complete','{\"status\":\"complete\",\"label\":\"Complete\"}','[[regtime]]'),('fraud','{\"status\":\"fraud\",\"label\":\"Suspected Fraud\"}','[[regtime]]'),('holded','{\"status\":\"holded\",\"label\":\"On Hold\"}','[[regtime]]'),('payment_review','{\"status\":\"payment_review\",\"label\":\"Payment Review\"}','[[regtime]]'),('paypal_canceled_reversal','{\"status\":\"paypal_canceled_reversal\",\"label\":\"PayPal Canceled Reversal\"}','[[regtime]]'),('paypal_reversed','{\"status\":\"paypal_reversed\",\"label\":\"PayPal Reversed\"}','[[regtime]]'),('pending','{\"status\":\"pending\",\"label\":\"Pending\"}','[[regtime]]'),('pending_payment','{\"status\":\"pending_payment\",\"label\":\"Pending Payment\"}','[[regtime]]'),('pending_paypal','{\"status\":\"pending_paypal\",\"label\":\"Pending PayPal\"}','[[regtime]]'),('processing','{\"status\":\"processing\",\"label\":\"Processing\"}','[[regtime]]');

--
-- Table structure for table `[[dbprefix]]sales_data_exporter_order_statuses_index_batches`
--

CREATE TABLE `[[dbprefix]]sales_data_exporter_order_statuses_index_batches` (
  `batch_number` int NOT NULL COMMENT 'Batch Number',
  `status` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Status',
  PRIMARY KEY (`batch_number`,`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='[[dbprefix]]sales_data_exporter_order_statuses_index_batches';

--
-- Dumping data for table `[[dbprefix]]sales_data_exporter_order_statuses_index_batches`
--

INSERT INTO `[[dbprefix]]sales_data_exporter_order_statuses_index_batches` VALUES (1,'canceled'),(1,'closed'),(1,'complete'),(1,'fraud'),(1,'holded'),(1,'payment_review'),(1,'paypal_canceled_reversal'),(1,'paypal_reversed'),(1,'pending'),(1,'pending_payment'),(1,'pending_paypal'),(1,'processing');

--
-- Table structure for table `[[dbprefix]]sales_data_exporter_order_statuses_index_sequence`
--

CREATE TABLE `[[dbprefix]]sales_data_exporter_order_statuses_index_sequence` (
  `i` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Auto Increment ID',
  PRIMARY KEY (`i`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT='[[dbprefix]]sales_data_exporter_order_statuses_index_sequence';

--
-- Dumping data for table `[[dbprefix]]sales_data_exporter_order_statuses_index_sequence`
--

INSERT INTO `[[dbprefix]]sales_data_exporter_order_statuses_index_sequence` VALUES (1),(2);

--
-- Table structure for table `[[dbprefix]]sales_data_exporter_orders`
--

CREATE TABLE `[[dbprefix]]sales_data_exporter_orders` (
  `id` int unsigned NOT NULL COMMENT 'ID',
  `mode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Order Payment Mode',
  `feed_data` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Feed Data',
  `modified_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Modified At',
  PRIMARY KEY (`id`),
  KEY `[[DBPREFIX]]SALES_DATA_EXPORTER_ORDERS_MODIFIED_AT` (`modified_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Orders Feed Storage';

--
-- Dumping data for table `[[dbprefix]]sales_data_exporter_orders`
--


--
-- Table structure for table `[[dbprefix]]sales_data_exporter_orders_index_batches`
--

CREATE TABLE `[[dbprefix]]sales_data_exporter_orders_index_batches` (
  `batch_number` int NOT NULL COMMENT 'Batch Number',
  `entity_id` int unsigned NOT NULL COMMENT 'Entity Id',
  PRIMARY KEY (`batch_number`,`entity_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='[[dbprefix]]sales_data_exporter_orders_index_batches';

--
-- Dumping data for table `[[dbprefix]]sales_data_exporter_orders_index_batches`
--


--
-- Table structure for table `[[dbprefix]]sales_data_exporter_orders_index_sequence`
--

CREATE TABLE `[[dbprefix]]sales_data_exporter_orders_index_sequence` (
  `i` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Auto Increment ID',
  PRIMARY KEY (`i`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='[[dbprefix]]sales_data_exporter_orders_index_sequence';

--
-- Dumping data for table `[[dbprefix]]sales_data_exporter_orders_index_sequence`
--


--
-- Table structure for table `[[dbprefix]]sales_invoice`
--

CREATE TABLE `[[dbprefix]]sales_invoice` (
  `entity_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `store_id` smallint unsigned DEFAULT NULL COMMENT 'Store ID',
  `base_grand_total` decimal(20,4) DEFAULT NULL COMMENT 'Base Grand Total',
  `shipping_tax_amount` decimal(20,4) DEFAULT NULL COMMENT 'Shipping Tax Amount',
  `tax_amount` decimal(20,4) DEFAULT NULL COMMENT 'Tax Amount',
  `base_tax_amount` decimal(20,4) DEFAULT NULL COMMENT 'Base Tax Amount',
  `store_to_order_rate` decimal(20,4) DEFAULT NULL COMMENT 'Store To Order Rate',
  `base_shipping_tax_amount` decimal(20,4) DEFAULT NULL COMMENT 'Base Shipping Tax Amount',
  `base_discount_amount` decimal(20,4) DEFAULT NULL COMMENT 'Base Discount Amount',
  `base_to_order_rate` decimal(20,4) DEFAULT NULL COMMENT 'Base To Order Rate',
  `grand_total` decimal(20,4) DEFAULT NULL COMMENT 'Grand Total',
  `shipping_amount` decimal(20,4) DEFAULT NULL COMMENT 'Shipping Amount',
  `subtotal_incl_tax` decimal(20,4) DEFAULT NULL COMMENT 'Subtotal Incl Tax',
  `base_subtotal_incl_tax` decimal(20,4) DEFAULT NULL COMMENT 'Base Subtotal Incl Tax',
  `store_to_base_rate` decimal(20,4) DEFAULT NULL COMMENT 'Store To Base Rate',
  `base_shipping_amount` decimal(20,4) DEFAULT NULL COMMENT 'Base Shipping Amount',
  `total_qty` decimal(12,4) DEFAULT NULL COMMENT 'Total Qty',
  `base_to_global_rate` decimal(20,4) DEFAULT NULL COMMENT 'Base To Global Rate',
  `subtotal` decimal(20,4) DEFAULT NULL COMMENT 'Subtotal',
  `base_subtotal` decimal(20,4) DEFAULT NULL COMMENT 'Base Subtotal',
  `discount_amount` decimal(20,4) DEFAULT NULL COMMENT 'Discount Amount',
  `billing_address_id` int DEFAULT NULL COMMENT 'Billing Address ID',
  `is_used_for_refund` smallint unsigned DEFAULT NULL COMMENT 'Is Used For Refund',
  `order_id` int unsigned NOT NULL COMMENT 'Order ID',
  `email_sent` smallint DEFAULT NULL COMMENT 'Email Sent',
  `send_email` smallint unsigned DEFAULT NULL COMMENT 'Send Email',
  `can_void_flag` smallint unsigned DEFAULT NULL COMMENT 'Can Void Flag',
  `state` int DEFAULT NULL COMMENT 'State',
  `shipping_address_id` int DEFAULT NULL COMMENT 'Shipping Address ID',
  `store_currency_code` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Store Currency Code',
  `transaction_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Transaction ID',
  `order_currency_code` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Order Currency Code',
  `base_currency_code` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Base Currency Code',
  `global_currency_code` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Global Currency Code',
  `increment_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Increment ID',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Created At',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Updated At',
  `discount_tax_compensation_amount` decimal(20,4) DEFAULT NULL COMMENT 'Discount Tax Compensation Amount',
  `base_discount_tax_compensation_amount` decimal(20,4) DEFAULT NULL COMMENT 'Base Discount Tax Compensation Amount',
  `shipping_discount_tax_compensation_amount` decimal(20,4) DEFAULT NULL COMMENT 'Shipping Discount Tax Compensation Amount',
  `base_shipping_discount_tax_compensation_amnt` decimal(20,4) DEFAULT NULL COMMENT 'Base Shipping Discount Tax Compensation Amount',
  `shipping_incl_tax` decimal(20,4) DEFAULT NULL COMMENT 'Shipping Incl Tax',
  `base_shipping_incl_tax` decimal(20,4) DEFAULT NULL COMMENT 'Base Shipping Incl Tax',
  `base_total_refunded` decimal(20,4) DEFAULT NULL COMMENT 'Base Total Refunded',
  `discount_description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Discount Description',
  `customer_note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Customer Note',
  `customer_note_notify` smallint unsigned DEFAULT NULL COMMENT 'Customer Note Notify',
  PRIMARY KEY (`entity_id`),
  UNIQUE KEY `[[DBPREFIX]]SALES_INVOICE_INCREMENT_ID_STORE_ID` (`increment_id`,`store_id`),
  KEY `[[DBPREFIX]]SALES_INVOICE_STORE_ID` (`store_id`),
  KEY `[[DBPREFIX]]SALES_INVOICE_GRAND_TOTAL` (`grand_total`),
  KEY `[[DBPREFIX]]SALES_INVOICE_ORDER_ID` (`order_id`),
  KEY `[[DBPREFIX]]SALES_INVOICE_STATE` (`state`),
  KEY `[[DBPREFIX]]SALES_INVOICE_CREATED_AT` (`created_at`),
  KEY `[[DBPREFIX]]SALES_INVOICE_UPDATED_AT` (`updated_at`),
  KEY `[[DBPREFIX]]SALES_INVOICE_SEND_EMAIL` (`send_email`),
  KEY `[[DBPREFIX]]SALES_INVOICE_EMAIL_SENT` (`email_sent`),
  CONSTRAINT `[[DBPREFIX]]SALES_INVOICE_ORDER_ID_[[DBPREFIX]]SALES_ORDER_ENTITY_ID` FOREIGN KEY (`order_id`) REFERENCES `[[dbprefix]]sales_order` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]SALES_INVOICE_STORE_ID_[[DBPREFIX]]STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Flat Invoice';

--
-- Dumping data for table `[[dbprefix]]sales_invoice`
--


--
-- Table structure for table `[[dbprefix]]sales_invoice_comment`
--

CREATE TABLE `[[dbprefix]]sales_invoice_comment` (
  `entity_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `parent_id` int unsigned NOT NULL COMMENT 'Parent ID',
  `is_customer_notified` smallint unsigned DEFAULT NULL COMMENT 'Is Customer Notified',
  `is_visible_on_front` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Is Visible On Front',
  `comment` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Comment',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Created At',
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Updated At',
  `user_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Admin User ID',
  `user_type` int unsigned NOT NULL DEFAULT '0' COMMENT 'User Type',
  PRIMARY KEY (`entity_id`),
  UNIQUE KEY `[[DBPREFIX]]SALES_INVOICE_COMMENT_ENTITY_ID_USER_ID_USER_TYPE` (`entity_id`,`user_id`,`user_type`),
  KEY `[[DBPREFIX]]SALES_INVOICE_COMMENT_CREATED_AT` (`created_at`),
  KEY `[[DBPREFIX]]SALES_INVOICE_COMMENT_PARENT_ID` (`parent_id`),
  CONSTRAINT `[[DBPREFIX]]SALES_INVOICE_COMMENT_PARENT_ID_[[DBPREFIX]]SALES_INVOICE_ENTT_ID` FOREIGN KEY (`parent_id`) REFERENCES `[[dbprefix]]sales_invoice` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Flat Invoice Comment';

--
-- Dumping data for table `[[dbprefix]]sales_invoice_comment`
--


--
-- Table structure for table `[[dbprefix]]sales_invoice_grid`
--

CREATE TABLE `[[dbprefix]]sales_invoice_grid` (
  `entity_id` int unsigned NOT NULL COMMENT 'Entity ID',
  `increment_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Increment ID',
  `state` int DEFAULT NULL COMMENT 'State',
  `store_id` smallint unsigned DEFAULT NULL COMMENT 'Store ID',
  `store_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Store Name',
  `order_id` int unsigned NOT NULL COMMENT 'Order ID',
  `order_increment_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Order Increment ID',
  `order_created_at` timestamp NULL DEFAULT NULL COMMENT 'Order Created At',
  `customer_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Customer Name',
  `customer_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Customer Email',
  `customer_group_id` int DEFAULT NULL,
  `payment_method` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Payment Method',
  `store_currency_code` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Store Currency Code',
  `order_currency_code` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Order Currency Code',
  `base_currency_code` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Base Currency Code',
  `global_currency_code` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Global Currency Code',
  `billing_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Billing Name',
  `billing_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Billing Address',
  `shipping_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Shipping Address',
  `shipping_information` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Shipping Method Name',
  `subtotal` decimal(20,4) DEFAULT NULL COMMENT 'Subtotal',
  `shipping_and_handling` decimal(20,4) DEFAULT NULL COMMENT 'Shipping and handling amount',
  `grand_total` decimal(20,4) DEFAULT NULL COMMENT 'Grand Total',
  `created_at` timestamp NULL DEFAULT NULL COMMENT 'Created At',
  `updated_at` timestamp NULL DEFAULT NULL COMMENT 'Updated At',
  `base_grand_total` decimal(20,4) DEFAULT NULL COMMENT 'Base Grand Total',
  PRIMARY KEY (`entity_id`),
  UNIQUE KEY `[[DBPREFIX]]SALES_INVOICE_GRID_INCREMENT_ID_STORE_ID` (`increment_id`,`store_id`),
  KEY `[[DBPREFIX]]SALES_INVOICE_GRID_STORE_ID` (`store_id`),
  KEY `[[DBPREFIX]]SALES_INVOICE_GRID_GRAND_TOTAL` (`grand_total`),
  KEY `[[DBPREFIX]]SALES_INVOICE_GRID_ORDER_ID` (`order_id`),
  KEY `[[DBPREFIX]]SALES_INVOICE_GRID_STATE` (`state`),
  KEY `[[DBPREFIX]]SALES_INVOICE_GRID_ORDER_INCREMENT_ID` (`order_increment_id`),
  KEY `[[DBPREFIX]]SALES_INVOICE_GRID_CREATED_AT` (`created_at`),
  KEY `[[DBPREFIX]]SALES_INVOICE_GRID_UPDATED_AT` (`updated_at`),
  KEY `[[DBPREFIX]]SALES_INVOICE_GRID_ORDER_CREATED_AT` (`order_created_at`),
  KEY `[[DBPREFIX]]SALES_INVOICE_GRID_BILLING_NAME` (`billing_name`),
  KEY `[[DBPREFIX]]SALES_INVOICE_GRID_BASE_GRAND_TOTAL` (`base_grand_total`),
  FULLTEXT KEY `FTI_A0EE7B3CDB178999DE2AC511FD6ACE5D` (`increment_id`,`order_increment_id`,`billing_name`,`billing_address`,`shipping_address`,`customer_name`,`customer_email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Flat Invoice Grid';

--
-- Dumping data for table `[[dbprefix]]sales_invoice_grid`
--


--
-- Table structure for table `[[dbprefix]]sales_invoice_item`
--

CREATE TABLE `[[dbprefix]]sales_invoice_item` (
  `entity_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `parent_id` int unsigned NOT NULL COMMENT 'Parent ID',
  `base_price` decimal(20,4) DEFAULT NULL COMMENT 'Base Price',
  `tax_amount` decimal(20,4) DEFAULT NULL COMMENT 'Tax Amount',
  `base_row_total` decimal(20,4) DEFAULT NULL COMMENT 'Base Row Total',
  `discount_amount` decimal(20,4) DEFAULT NULL COMMENT 'Discount Amount',
  `row_total` decimal(20,4) DEFAULT NULL COMMENT 'Row Total',
  `base_discount_amount` decimal(20,4) DEFAULT NULL COMMENT 'Base Discount Amount',
  `price_incl_tax` decimal(20,4) DEFAULT NULL COMMENT 'Price Incl Tax',
  `base_tax_amount` decimal(20,4) DEFAULT NULL COMMENT 'Base Tax Amount',
  `base_price_incl_tax` decimal(20,4) DEFAULT NULL COMMENT 'Base Price Incl Tax',
  `qty` decimal(12,4) DEFAULT NULL COMMENT 'Qty',
  `base_cost` decimal(20,4) DEFAULT NULL COMMENT 'Base Cost',
  `price` decimal(20,4) DEFAULT NULL COMMENT 'Price',
  `base_row_total_incl_tax` decimal(20,4) DEFAULT NULL COMMENT 'Base Row Total Incl Tax',
  `row_total_incl_tax` decimal(20,4) DEFAULT NULL COMMENT 'Row Total Incl Tax',
  `product_id` int DEFAULT NULL COMMENT 'Product ID',
  `order_item_id` int DEFAULT NULL COMMENT 'Order Item ID',
  `additional_data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Additional Data',
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Description',
  `sku` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Sku',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Name',
  `discount_tax_compensation_amount` decimal(20,4) DEFAULT NULL COMMENT 'Discount Tax Compensation Amount',
  `base_discount_tax_compensation_amount` decimal(20,4) DEFAULT NULL COMMENT 'Base Discount Tax Compensation Amount',
  `tax_ratio` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Ratio of tax invoiced over tax of the order item',
  `weee_tax_applied` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Weee Tax Applied',
  `weee_tax_applied_amount` decimal(12,4) DEFAULT NULL COMMENT 'Weee Tax Applied Amount',
  `weee_tax_applied_row_amount` decimal(12,4) DEFAULT NULL COMMENT 'Weee Tax Applied Row Amount',
  `weee_tax_disposition` decimal(12,4) DEFAULT NULL COMMENT 'Weee Tax Disposition',
  `weee_tax_row_disposition` decimal(12,4) DEFAULT NULL COMMENT 'Weee Tax Row Disposition',
  `base_weee_tax_applied_amount` decimal(12,4) DEFAULT NULL COMMENT 'Base Weee Tax Applied Amount',
  `base_weee_tax_applied_row_amnt` decimal(12,4) DEFAULT NULL COMMENT 'Base Weee Tax Applied Row Amnt',
  `base_weee_tax_disposition` decimal(12,4) DEFAULT NULL COMMENT 'Base Weee Tax Disposition',
  `base_weee_tax_row_disposition` decimal(12,4) DEFAULT NULL COMMENT 'Base Weee Tax Row Disposition',
  PRIMARY KEY (`entity_id`),
  KEY `[[DBPREFIX]]SALES_INVOICE_ITEM_PARENT_ID` (`parent_id`),
  CONSTRAINT `[[DBPREFIX]]SALES_INVOICE_ITEM_PARENT_ID_[[DBPREFIX]]SALES_INVOICE_ENTITY_ID` FOREIGN KEY (`parent_id`) REFERENCES `[[dbprefix]]sales_invoice` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Flat Invoice Item';

--
-- Dumping data for table `[[dbprefix]]sales_invoice_item`
--


--
-- Table structure for table `[[dbprefix]]sales_invoiced_aggregated`
--

CREATE TABLE `[[dbprefix]]sales_invoiced_aggregated` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `period` date DEFAULT NULL COMMENT 'Period',
  `store_id` smallint unsigned DEFAULT NULL COMMENT 'Store ID',
  `order_status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Order Status',
  `orders_count` int NOT NULL DEFAULT '0' COMMENT 'Orders Count',
  `orders_invoiced` decimal(20,4) DEFAULT NULL COMMENT 'Orders Invoiced',
  `invoiced` decimal(20,4) DEFAULT NULL COMMENT 'Invoiced',
  `invoiced_captured` decimal(20,4) DEFAULT NULL COMMENT 'Invoiced Captured',
  `invoiced_not_captured` decimal(20,4) DEFAULT NULL COMMENT 'Invoiced Not Captured',
  PRIMARY KEY (`id`),
  UNIQUE KEY `[[DBPREFIX]]SALES_INVOICED_AGGREGATED_PERIOD_STORE_ID_ORDER_STATUS` (`period`,`store_id`,`order_status`),
  KEY `[[DBPREFIX]]SALES_INVOICED_AGGREGATED_STORE_ID` (`store_id`),
  CONSTRAINT `[[DBPREFIX]]SALES_INVOICED_AGGREGATED_STORE_ID_[[DBPREFIX]]STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Invoiced Aggregated';

--
-- Dumping data for table `[[dbprefix]]sales_invoiced_aggregated`
--


--
-- Table structure for table `[[dbprefix]]sales_invoiced_aggregated_order`
--

CREATE TABLE `[[dbprefix]]sales_invoiced_aggregated_order` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `period` date DEFAULT NULL COMMENT 'Period',
  `store_id` smallint unsigned DEFAULT NULL COMMENT 'Store ID',
  `order_status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Order Status',
  `orders_count` int NOT NULL DEFAULT '0' COMMENT 'Orders Count',
  `orders_invoiced` decimal(20,4) DEFAULT NULL COMMENT 'Orders Invoiced',
  `invoiced` decimal(20,4) DEFAULT NULL COMMENT 'Invoiced',
  `invoiced_captured` decimal(20,4) DEFAULT NULL COMMENT 'Invoiced Captured',
  `invoiced_not_captured` decimal(20,4) DEFAULT NULL COMMENT 'Invoiced Not Captured',
  PRIMARY KEY (`id`),
  UNIQUE KEY `[[DBPREFIX]]SALES_INVOICED_AGGRED_ORDER_PERIOD_STORE_ID_ORDER_STS` (`period`,`store_id`,`order_status`),
  KEY `[[DBPREFIX]]SALES_INVOICED_AGGREGATED_ORDER_STORE_ID` (`store_id`),
  CONSTRAINT `[[DBPREFIX]]SALES_INVOICED_AGGRED_ORDER_STORE_ID_[[DBPREFIX]]STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Invoiced Aggregated Order';

--
-- Dumping data for table `[[dbprefix]]sales_invoiced_aggregated_order`
--


--
-- Table structure for table `[[dbprefix]]sales_order`
--

CREATE TABLE `[[dbprefix]]sales_order` (
  `entity_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `state` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'State',
  `status` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Status',
  `coupon_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Coupon Code',
  `protect_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Protect Code',
  `shipping_description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Shipping Description',
  `is_virtual` smallint unsigned DEFAULT NULL COMMENT 'Is Virtual',
  `store_id` smallint unsigned DEFAULT NULL COMMENT 'Store ID',
  `customer_id` int unsigned DEFAULT NULL COMMENT 'Customer ID',
  `base_discount_amount` decimal(20,4) DEFAULT NULL COMMENT 'Base Discount Amount',
  `base_discount_canceled` decimal(20,4) DEFAULT NULL COMMENT 'Base Discount Canceled',
  `base_discount_invoiced` decimal(20,4) DEFAULT NULL COMMENT 'Base Discount Invoiced',
  `base_discount_refunded` decimal(20,4) DEFAULT NULL COMMENT 'Base Discount Refunded',
  `base_grand_total` decimal(20,4) DEFAULT NULL COMMENT 'Base Grand Total',
  `base_shipping_amount` decimal(20,4) DEFAULT NULL COMMENT 'Base Shipping Amount',
  `base_shipping_canceled` decimal(20,4) DEFAULT NULL COMMENT 'Base Shipping Canceled',
  `base_shipping_invoiced` decimal(20,4) DEFAULT NULL COMMENT 'Base Shipping Invoiced',
  `base_shipping_refunded` decimal(20,4) DEFAULT NULL COMMENT 'Base Shipping Refunded',
  `base_shipping_tax_amount` decimal(20,4) DEFAULT NULL COMMENT 'Base Shipping Tax Amount',
  `base_shipping_tax_refunded` decimal(20,4) DEFAULT NULL COMMENT 'Base Shipping Tax Refunded',
  `base_subtotal` decimal(20,4) DEFAULT NULL COMMENT 'Base Subtotal',
  `base_subtotal_canceled` decimal(20,4) DEFAULT NULL COMMENT 'Base Subtotal Canceled',
  `base_subtotal_invoiced` decimal(20,4) DEFAULT NULL COMMENT 'Base Subtotal Invoiced',
  `base_subtotal_refunded` decimal(20,4) DEFAULT NULL COMMENT 'Base Subtotal Refunded',
  `base_tax_amount` decimal(20,4) DEFAULT NULL COMMENT 'Base Tax Amount',
  `base_tax_canceled` decimal(20,4) DEFAULT NULL COMMENT 'Base Tax Canceled',
  `base_tax_invoiced` decimal(20,4) DEFAULT NULL COMMENT 'Base Tax Invoiced',
  `base_tax_refunded` decimal(20,4) DEFAULT NULL COMMENT 'Base Tax Refunded',
  `base_to_global_rate` decimal(20,4) DEFAULT NULL COMMENT 'Base To Global Rate',
  `base_to_order_rate` decimal(20,4) DEFAULT NULL COMMENT 'Base To Order Rate',
  `base_total_canceled` decimal(20,4) DEFAULT NULL COMMENT 'Base Total Canceled',
  `base_total_invoiced` decimal(20,4) DEFAULT NULL COMMENT 'Base Total Invoiced',
  `base_total_invoiced_cost` decimal(20,4) DEFAULT NULL COMMENT 'Base Total Invoiced Cost',
  `base_total_offline_refunded` decimal(20,4) DEFAULT NULL COMMENT 'Base Total Offline Refunded',
  `base_total_online_refunded` decimal(20,4) DEFAULT NULL COMMENT 'Base Total Online Refunded',
  `base_total_paid` decimal(20,4) DEFAULT NULL COMMENT 'Base Total Paid',
  `base_total_qty_ordered` decimal(12,4) DEFAULT NULL COMMENT 'Base Total Qty Ordered',
  `base_total_refunded` decimal(20,4) DEFAULT NULL COMMENT 'Base Total Refunded',
  `discount_amount` decimal(20,4) DEFAULT NULL COMMENT 'Discount Amount',
  `discount_canceled` decimal(20,4) DEFAULT NULL COMMENT 'Discount Canceled',
  `discount_invoiced` decimal(20,4) DEFAULT NULL COMMENT 'Discount Invoiced',
  `discount_refunded` decimal(20,4) DEFAULT NULL COMMENT 'Discount Refunded',
  `grand_total` decimal(20,4) DEFAULT NULL COMMENT 'Grand Total',
  `shipping_amount` decimal(20,4) DEFAULT NULL COMMENT 'Shipping Amount',
  `shipping_canceled` decimal(20,4) DEFAULT NULL COMMENT 'Shipping Canceled',
  `shipping_invoiced` decimal(20,4) DEFAULT NULL COMMENT 'Shipping Invoiced',
  `shipping_refunded` decimal(20,4) DEFAULT NULL COMMENT 'Shipping Refunded',
  `shipping_tax_amount` decimal(20,4) DEFAULT NULL COMMENT 'Shipping Tax Amount',
  `shipping_tax_refunded` decimal(20,4) DEFAULT NULL COMMENT 'Shipping Tax Refunded',
  `store_to_base_rate` decimal(12,4) DEFAULT NULL COMMENT 'Store To Base Rate',
  `store_to_order_rate` decimal(12,4) DEFAULT NULL COMMENT 'Store To Order Rate',
  `subtotal` decimal(20,4) DEFAULT NULL COMMENT 'Subtotal',
  `subtotal_canceled` decimal(20,4) DEFAULT NULL COMMENT 'Subtotal Canceled',
  `subtotal_invoiced` decimal(20,4) DEFAULT NULL COMMENT 'Subtotal Invoiced',
  `subtotal_refunded` decimal(20,4) DEFAULT NULL COMMENT 'Subtotal Refunded',
  `tax_amount` decimal(20,4) DEFAULT NULL COMMENT 'Tax Amount',
  `tax_canceled` decimal(20,4) DEFAULT NULL COMMENT 'Tax Canceled',
  `tax_invoiced` decimal(20,4) DEFAULT NULL COMMENT 'Tax Invoiced',
  `tax_refunded` decimal(20,4) DEFAULT NULL COMMENT 'Tax Refunded',
  `total_canceled` decimal(20,4) DEFAULT NULL COMMENT 'Total Canceled',
  `total_invoiced` decimal(20,4) DEFAULT NULL COMMENT 'Total Invoiced',
  `total_offline_refunded` decimal(20,4) DEFAULT NULL COMMENT 'Total Offline Refunded',
  `total_online_refunded` decimal(20,4) DEFAULT NULL COMMENT 'Total Online Refunded',
  `total_paid` decimal(20,4) DEFAULT NULL COMMENT 'Total Paid',
  `total_qty_ordered` decimal(12,4) DEFAULT NULL COMMENT 'Total Qty Ordered',
  `total_refunded` decimal(20,4) DEFAULT NULL COMMENT 'Total Refunded',
  `can_ship_partially` smallint unsigned DEFAULT NULL COMMENT 'Can Ship Partially',
  `can_ship_partially_item` smallint unsigned DEFAULT NULL COMMENT 'Can Ship Partially Item',
  `customer_is_guest` smallint unsigned DEFAULT NULL COMMENT 'Customer Is Guest',
  `customer_note_notify` smallint unsigned DEFAULT NULL COMMENT 'Customer Note Notify',
  `billing_address_id` int DEFAULT NULL COMMENT 'Billing Address ID',
  `customer_group_id` int DEFAULT NULL,
  `edit_increment` int DEFAULT NULL COMMENT 'Edit Increment',
  `email_sent` smallint DEFAULT NULL COMMENT 'Email Sent',
  `send_email` smallint unsigned DEFAULT NULL COMMENT 'Send Email',
  `forced_shipment_with_invoice` smallint unsigned DEFAULT NULL COMMENT 'Forced Do Shipment With Invoice',
  `payment_auth_expiration` int DEFAULT NULL COMMENT 'Payment Authorization Expiration',
  `quote_address_id` int DEFAULT NULL COMMENT 'Quote Address ID',
  `quote_id` int DEFAULT NULL COMMENT 'Quote ID',
  `shipping_address_id` int DEFAULT NULL COMMENT 'Shipping Address ID',
  `adjustment_negative` decimal(20,4) DEFAULT NULL COMMENT 'Adjustment Negative',
  `adjustment_positive` decimal(20,4) DEFAULT NULL COMMENT 'Adjustment Positive',
  `base_adjustment_negative` decimal(20,4) DEFAULT NULL COMMENT 'Base Adjustment Negative',
  `base_adjustment_positive` decimal(20,4) DEFAULT NULL COMMENT 'Base Adjustment Positive',
  `base_shipping_discount_amount` decimal(20,4) DEFAULT NULL COMMENT 'Base Shipping Discount Amount',
  `base_subtotal_incl_tax` decimal(20,4) DEFAULT NULL COMMENT 'Base Subtotal Incl Tax',
  `base_total_due` decimal(20,4) DEFAULT NULL COMMENT 'Base Total Due',
  `payment_authorization_amount` decimal(20,4) DEFAULT NULL COMMENT 'Payment Authorization Amount',
  `shipping_discount_amount` decimal(20,4) DEFAULT NULL COMMENT 'Shipping Discount Amount',
  `subtotal_incl_tax` decimal(20,4) DEFAULT NULL COMMENT 'Subtotal Incl Tax',
  `total_due` decimal(20,4) DEFAULT NULL COMMENT 'Total Due',
  `weight` decimal(12,4) DEFAULT NULL COMMENT 'Weight',
  `customer_dob` datetime DEFAULT NULL COMMENT 'Customer Dob',
  `increment_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Increment ID',
  `applied_rule_ids` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Applied Rule Ids',
  `base_currency_code` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Base Currency Code',
  `customer_email` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Customer Email',
  `customer_firstname` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Customer Firstname',
  `customer_lastname` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Customer Lastname',
  `customer_middlename` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Customer Middlename',
  `customer_prefix` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Customer Prefix',
  `customer_suffix` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Customer Suffix',
  `customer_taxvat` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Customer Taxvat',
  `discount_description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Discount Description',
  `ext_customer_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Ext Customer ID',
  `ext_order_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Ext Order ID',
  `global_currency_code` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Global Currency Code',
  `hold_before_state` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Hold Before State',
  `hold_before_status` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Hold Before Status',
  `order_currency_code` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Order Currency Code',
  `original_increment_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Original Increment ID',
  `relation_child_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Relation Child ID',
  `relation_child_real_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Relation Child Real ID',
  `relation_parent_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Relation Parent ID',
  `relation_parent_real_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Relation Parent Real ID',
  `remote_ip` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Remote Ip',
  `shipping_method` varchar(120) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `store_currency_code` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Store Currency Code',
  `store_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Store Name',
  `x_forwarded_for` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'X Forwarded For',
  `customer_note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Customer Note',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Created At',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Updated At',
  `total_item_count` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Total Item Count',
  `customer_gender` int DEFAULT NULL COMMENT 'Customer Gender',
  `discount_tax_compensation_amount` decimal(20,4) DEFAULT NULL COMMENT 'Discount Tax Compensation Amount',
  `base_discount_tax_compensation_amount` decimal(20,4) DEFAULT NULL COMMENT 'Base Discount Tax Compensation Amount',
  `shipping_discount_tax_compensation_amount` decimal(20,4) DEFAULT NULL COMMENT 'Shipping Discount Tax Compensation Amount',
  `base_shipping_discount_tax_compensation_amnt` decimal(20,4) DEFAULT NULL COMMENT 'Base Shipping Discount Tax Compensation Amount',
  `discount_tax_compensation_invoiced` decimal(20,4) DEFAULT NULL COMMENT 'Discount Tax Compensation Invoiced',
  `base_discount_tax_compensation_invoiced` decimal(20,4) DEFAULT NULL COMMENT 'Base Discount Tax Compensation Invoiced',
  `discount_tax_compensation_refunded` decimal(20,4) DEFAULT NULL COMMENT 'Discount Tax Compensation Refunded',
  `base_discount_tax_compensation_refunded` decimal(20,4) DEFAULT NULL COMMENT 'Base Discount Tax Compensation Refunded',
  `shipping_incl_tax` decimal(20,4) DEFAULT NULL COMMENT 'Shipping Incl Tax',
  `base_shipping_incl_tax` decimal(20,4) DEFAULT NULL COMMENT 'Base Shipping Incl Tax',
  `coupon_rule_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Coupon Sales Rule Name',
  `gift_message_id` int DEFAULT NULL COMMENT 'Gift Message ID',
  `paypal_ipn_customer_notified` int DEFAULT '0' COMMENT 'Paypal Ipn Customer Notified',
  `dispute_status` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Braintree Dispute Status',
  PRIMARY KEY (`entity_id`),
  UNIQUE KEY `[[DBPREFIX]]SALES_ORDER_INCREMENT_ID_STORE_ID` (`increment_id`,`store_id`),
  KEY `[[DBPREFIX]]SALES_ORDER_STATUS` (`status`),
  KEY `[[DBPREFIX]]SALES_ORDER_STATE` (`state`),
  KEY `[[DBPREFIX]]SALES_ORDER_STORE_ID` (`store_id`),
  KEY `[[DBPREFIX]]SALES_ORDER_CREATED_AT` (`created_at`),
  KEY `[[DBPREFIX]]SALES_ORDER_CUSTOMER_ID` (`customer_id`),
  KEY `[[DBPREFIX]]SALES_ORDER_EXT_ORDER_ID` (`ext_order_id`),
  KEY `[[DBPREFIX]]SALES_ORDER_QUOTE_ID` (`quote_id`),
  KEY `[[DBPREFIX]]SALES_ORDER_UPDATED_AT` (`updated_at`),
  KEY `[[DBPREFIX]]SALES_ORDER_SEND_EMAIL` (`send_email`),
  KEY `[[DBPREFIX]]SALES_ORDER_EMAIL_SENT` (`email_sent`),
  KEY `[[DBPREFIX]]SALES_ORDER_STORE_ID_STATE_CREATED_AT` (`store_id`,`state`,`created_at`),
  CONSTRAINT `[[DBPREFIX]]SALES_ORDER_CUSTOMER_ID_[[DBPREFIX]]CUSTOMER_ENTITY_ENTITY_ID` FOREIGN KEY (`customer_id`) REFERENCES `[[dbprefix]]customer_entity` (`entity_id`) ON DELETE SET NULL,
  CONSTRAINT `[[DBPREFIX]]SALES_ORDER_STORE_ID_[[DBPREFIX]]STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Flat Order';

--
-- Dumping data for table `[[dbprefix]]sales_order`
--


--
-- Table structure for table `[[dbprefix]]sales_order_address`
--

CREATE TABLE `[[dbprefix]]sales_order_address` (
  `entity_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `parent_id` int unsigned DEFAULT NULL COMMENT 'Parent ID',
  `customer_address_id` int DEFAULT NULL COMMENT 'Customer Address ID',
  `quote_address_id` int DEFAULT NULL COMMENT 'Quote Address ID',
  `region_id` int DEFAULT NULL COMMENT 'Region ID',
  `customer_id` int DEFAULT NULL COMMENT 'Customer ID',
  `fax` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Fax',
  `region` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Region',
  `postcode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Postcode',
  `lastname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Lastname',
  `street` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Street',
  `city` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'City',
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Email',
  `telephone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Phone Number',
  `country_id` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Country ID',
  `firstname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Firstname',
  `address_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Address Type',
  `prefix` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Prefix',
  `middlename` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Middlename',
  `suffix` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Suffix',
  `company` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Company',
  `vat_id` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Vat ID',
  `vat_is_valid` smallint DEFAULT NULL COMMENT 'Vat Is Valid',
  `vat_request_id` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Vat Request ID',
  `vat_request_date` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Vat Request Date',
  `vat_request_success` smallint DEFAULT NULL COMMENT 'Vat Request Success',
  PRIMARY KEY (`entity_id`),
  KEY `[[DBPREFIX]]SALES_ORDER_ADDRESS_PARENT_ID` (`parent_id`),
  CONSTRAINT `[[DBPREFIX]]SALES_ORDER_ADDRESS_PARENT_ID_[[DBPREFIX]]SALES_ORDER_ENTITY_ID` FOREIGN KEY (`parent_id`) REFERENCES `[[dbprefix]]sales_order` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Flat Order Address';

--
-- Dumping data for table `[[dbprefix]]sales_order_address`
--


--
-- Table structure for table `[[dbprefix]]sales_order_aggregated_created`
--

CREATE TABLE `[[dbprefix]]sales_order_aggregated_created` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `period` date DEFAULT NULL COMMENT 'Period',
  `store_id` smallint unsigned DEFAULT NULL COMMENT 'Store ID',
  `order_status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Order Status',
  `orders_count` int NOT NULL DEFAULT '0' COMMENT 'Orders Count',
  `total_qty_ordered` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Qty Ordered',
  `total_qty_invoiced` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Qty Invoiced',
  `total_income_amount` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Income Amount',
  `total_revenue_amount` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Revenue Amount',
  `total_profit_amount` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Profit Amount',
  `total_invoiced_amount` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Invoiced Amount',
  `total_canceled_amount` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Canceled Amount',
  `total_paid_amount` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Paid Amount',
  `total_refunded_amount` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Refunded Amount',
  `total_tax_amount` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Tax Amount',
  `total_tax_amount_actual` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Tax Amount Actual',
  `total_shipping_amount` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Shipping Amount',
  `total_shipping_amount_actual` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Shipping Amount Actual',
  `total_discount_amount` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Discount Amount',
  `total_discount_amount_actual` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Discount Amount Actual',
  PRIMARY KEY (`id`),
  UNIQUE KEY `[[DBPREFIX]]SALES_ORDER_AGGREGATED_CREATED_PERIOD_STORE_ID_ORDER_STATUS` (`period`,`store_id`,`order_status`),
  KEY `[[DBPREFIX]]SALES_ORDER_AGGREGATED_CREATED_STORE_ID` (`store_id`),
  CONSTRAINT `[[DBPREFIX]]SALES_ORDER_AGGREGATED_CREATED_STORE_ID_[[DBPREFIX]]STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Order Aggregated Created';

--
-- Dumping data for table `[[dbprefix]]sales_order_aggregated_created`
--


--
-- Table structure for table `[[dbprefix]]sales_order_aggregated_updated`
--

CREATE TABLE `[[dbprefix]]sales_order_aggregated_updated` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `period` date DEFAULT NULL COMMENT 'Period',
  `store_id` smallint unsigned DEFAULT NULL COMMENT 'Store ID',
  `order_status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Order Status',
  `orders_count` int NOT NULL DEFAULT '0' COMMENT 'Orders Count',
  `total_qty_ordered` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Qty Ordered',
  `total_qty_invoiced` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Qty Invoiced',
  `total_income_amount` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Income Amount',
  `total_revenue_amount` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Revenue Amount',
  `total_profit_amount` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Profit Amount',
  `total_invoiced_amount` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Invoiced Amount',
  `total_canceled_amount` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Canceled Amount',
  `total_paid_amount` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Paid Amount',
  `total_refunded_amount` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Refunded Amount',
  `total_tax_amount` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Tax Amount',
  `total_tax_amount_actual` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Tax Amount Actual',
  `total_shipping_amount` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Shipping Amount',
  `total_shipping_amount_actual` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Shipping Amount Actual',
  `total_discount_amount` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Discount Amount',
  `total_discount_amount_actual` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Discount Amount Actual',
  PRIMARY KEY (`id`),
  UNIQUE KEY `[[DBPREFIX]]SALES_ORDER_AGGREGATED_UPDATED_PERIOD_STORE_ID_ORDER_STATUS` (`period`,`store_id`,`order_status`),
  KEY `[[DBPREFIX]]SALES_ORDER_AGGREGATED_UPDATED_STORE_ID` (`store_id`),
  CONSTRAINT `[[DBPREFIX]]SALES_ORDER_AGGREGATED_UPDATED_STORE_ID_[[DBPREFIX]]STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Order Aggregated Updated';

--
-- Dumping data for table `[[dbprefix]]sales_order_aggregated_updated`
--


--
-- Table structure for table `[[dbprefix]]sales_order_confirm_cancel`
--

CREATE TABLE `[[dbprefix]]sales_order_confirm_cancel` (
  `order_id` int unsigned NOT NULL COMMENT 'Order ID',
  `confirmation_key` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Random key',
  `reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Cancellation reason',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'created at',
  PRIMARY KEY (`order_id`),
  CONSTRAINT `FK_03CCFA99C5B542E2E2B2E14012FA1F07` FOREIGN KEY (`order_id`) REFERENCES `[[dbprefix]]sales_order` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Save the confirmation key to cancel guest order';

--
-- Dumping data for table `[[dbprefix]]sales_order_confirm_cancel`
--


--
-- Table structure for table `[[dbprefix]]sales_order_data_exporter_cl`
--

CREATE TABLE `[[dbprefix]]sales_order_data_exporter_cl` (
  `version_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Version ID',
  `entity_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Entity ID',
  PRIMARY KEY (`version_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='[[dbprefix]]sales_order_data_exporter_cl';

--
-- Dumping data for table `[[dbprefix]]sales_order_data_exporter_cl`
--


--
-- Table structure for table `[[dbprefix]]sales_order_grid`
--

CREATE TABLE `[[dbprefix]]sales_order_grid` (
  `entity_id` int unsigned NOT NULL COMMENT 'Entity ID',
  `status` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Status',
  `store_id` smallint unsigned DEFAULT NULL COMMENT 'Store ID',
  `store_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Store Name',
  `customer_id` int unsigned DEFAULT NULL COMMENT 'Customer ID',
  `base_grand_total` decimal(20,4) DEFAULT NULL COMMENT 'Base Grand Total',
  `base_total_paid` decimal(20,4) DEFAULT NULL COMMENT 'Base Total Paid',
  `grand_total` decimal(20,4) DEFAULT NULL COMMENT 'Grand Total',
  `total_paid` decimal(20,4) DEFAULT NULL COMMENT 'Total Paid',
  `increment_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Increment ID',
  `base_currency_code` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Base Currency Code',
  `order_currency_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Order Currency Code',
  `shipping_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Shipping Name',
  `billing_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Billing Name',
  `created_at` timestamp NULL DEFAULT NULL COMMENT 'Created At',
  `updated_at` timestamp NULL DEFAULT NULL COMMENT 'Updated At',
  `billing_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Billing Address',
  `shipping_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Shipping Address',
  `shipping_information` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Shipping Method Name',
  `customer_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Customer Email',
  `customer_group` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Customer Group',
  `subtotal` decimal(20,4) DEFAULT NULL COMMENT 'Subtotal',
  `shipping_and_handling` decimal(20,4) DEFAULT NULL COMMENT 'Shipping and handling amount',
  `customer_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Customer Name',
  `payment_method` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Payment Method',
  `total_refunded` decimal(20,4) DEFAULT NULL COMMENT 'Total Refunded',
  `pickup_location_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Pickup Location Code',
  `dispute_status` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Braintree Dispute Status',
  PRIMARY KEY (`entity_id`),
  UNIQUE KEY `[[DBPREFIX]]SALES_ORDER_GRID_INCREMENT_ID_STORE_ID` (`increment_id`,`store_id`),
  KEY `[[DBPREFIX]]SALES_ORDER_GRID_STATUS` (`status`),
  KEY `[[DBPREFIX]]SALES_ORDER_GRID_STORE_ID` (`store_id`),
  KEY `[[DBPREFIX]]SALES_ORDER_GRID_BASE_GRAND_TOTAL` (`base_grand_total`),
  KEY `[[DBPREFIX]]SALES_ORDER_GRID_BASE_TOTAL_PAID` (`base_total_paid`),
  KEY `[[DBPREFIX]]SALES_ORDER_GRID_GRAND_TOTAL` (`grand_total`),
  KEY `[[DBPREFIX]]SALES_ORDER_GRID_TOTAL_PAID` (`total_paid`),
  KEY `[[DBPREFIX]]SALES_ORDER_GRID_SHIPPING_NAME` (`shipping_name`),
  KEY `[[DBPREFIX]]SALES_ORDER_GRID_BILLING_NAME` (`billing_name`),
  KEY `[[DBPREFIX]]SALES_ORDER_GRID_CREATED_AT` (`created_at`),
  KEY `[[DBPREFIX]]SALES_ORDER_GRID_CUSTOMER_ID` (`customer_id`),
  KEY `[[DBPREFIX]]SALES_ORDER_GRID_UPDATED_AT` (`updated_at`),
  KEY `[[DBPREFIX]]SALES_ORDER_GRID_PICKUP_LOCATION_CODE` (`pickup_location_code`),
  FULLTEXT KEY `FTI_B1EE20E09A9B65FBC10BE8CC9A273F85` (`increment_id`,`billing_name`,`shipping_name`,`shipping_address`,`billing_address`,`customer_name`,`customer_email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Flat Order Grid';

--
-- Dumping data for table `[[dbprefix]]sales_order_grid`
--


--
-- Table structure for table `[[dbprefix]]sales_order_item`
--

CREATE TABLE `[[dbprefix]]sales_order_item` (
  `item_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Item ID',
  `order_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Order ID',
  `parent_item_id` int unsigned DEFAULT NULL COMMENT 'Parent Item ID',
  `quote_item_id` int unsigned DEFAULT NULL COMMENT 'Quote Item ID',
  `store_id` smallint unsigned DEFAULT NULL COMMENT 'Store ID',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Created At',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Updated At',
  `product_id` int unsigned DEFAULT NULL COMMENT 'Product ID',
  `product_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Product Type',
  `product_options` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Product Options',
  `weight` decimal(12,4) DEFAULT '0.0000' COMMENT 'Weight',
  `is_virtual` smallint unsigned DEFAULT NULL COMMENT 'Is Virtual',
  `sku` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Sku',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Name',
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Description',
  `applied_rule_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Applied Rule Ids',
  `additional_data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Additional Data',
  `is_qty_decimal` smallint unsigned DEFAULT NULL COMMENT 'Is Qty Decimal',
  `no_discount` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'No Discount',
  `qty_backordered` decimal(12,4) DEFAULT '0.0000' COMMENT 'Qty Backordered',
  `qty_canceled` decimal(12,4) DEFAULT '0.0000' COMMENT 'Qty Canceled',
  `qty_invoiced` decimal(12,4) DEFAULT '0.0000' COMMENT 'Qty Invoiced',
  `qty_ordered` decimal(12,4) DEFAULT '0.0000' COMMENT 'Qty Ordered',
  `qty_refunded` decimal(12,4) DEFAULT '0.0000' COMMENT 'Qty Refunded',
  `qty_shipped` decimal(12,4) DEFAULT '0.0000' COMMENT 'Qty Shipped',
  `base_cost` decimal(12,4) DEFAULT '0.0000' COMMENT 'Base Cost',
  `price` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Price',
  `base_price` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Base Price',
  `original_price` decimal(20,4) DEFAULT NULL COMMENT 'Original Price',
  `base_original_price` decimal(20,4) DEFAULT NULL COMMENT 'Base Original Price',
  `tax_percent` decimal(12,4) DEFAULT '0.0000' COMMENT 'Tax Percent',
  `tax_amount` decimal(20,4) DEFAULT '0.0000' COMMENT 'Tax Amount',
  `base_tax_amount` decimal(20,4) DEFAULT '0.0000' COMMENT 'Base Tax Amount',
  `tax_invoiced` decimal(20,4) DEFAULT '0.0000' COMMENT 'Tax Invoiced',
  `base_tax_invoiced` decimal(20,4) DEFAULT '0.0000' COMMENT 'Base Tax Invoiced',
  `discount_percent` decimal(12,4) DEFAULT '0.0000' COMMENT 'Discount Percent',
  `discount_amount` decimal(20,4) DEFAULT '0.0000' COMMENT 'Discount Amount',
  `base_discount_amount` decimal(20,4) DEFAULT '0.0000' COMMENT 'Base Discount Amount',
  `discount_invoiced` decimal(20,4) DEFAULT '0.0000' COMMENT 'Discount Invoiced',
  `base_discount_invoiced` decimal(20,4) DEFAULT '0.0000' COMMENT 'Base Discount Invoiced',
  `amount_refunded` decimal(20,4) DEFAULT '0.0000' COMMENT 'Amount Refunded',
  `base_amount_refunded` decimal(20,4) DEFAULT '0.0000' COMMENT 'Base Amount Refunded',
  `row_total` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Row Total',
  `base_row_total` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Base Row Total',
  `row_invoiced` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Row Invoiced',
  `base_row_invoiced` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Base Row Invoiced',
  `row_weight` decimal(12,4) DEFAULT '0.0000' COMMENT 'Row Weight',
  `base_tax_before_discount` decimal(20,4) DEFAULT NULL COMMENT 'Base Tax Before Discount',
  `tax_before_discount` decimal(20,4) DEFAULT NULL COMMENT 'Tax Before Discount',
  `ext_order_item_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Ext Order Item ID',
  `locked_do_invoice` smallint unsigned DEFAULT NULL COMMENT 'Locked Do Invoice',
  `locked_do_ship` smallint unsigned DEFAULT NULL COMMENT 'Locked Do Ship',
  `price_incl_tax` decimal(20,4) DEFAULT NULL COMMENT 'Price Incl Tax',
  `base_price_incl_tax` decimal(20,4) DEFAULT NULL COMMENT 'Base Price Incl Tax',
  `row_total_incl_tax` decimal(20,4) DEFAULT NULL COMMENT 'Row Total Incl Tax',
  `base_row_total_incl_tax` decimal(20,4) DEFAULT NULL COMMENT 'Base Row Total Incl Tax',
  `discount_tax_compensation_amount` decimal(20,4) DEFAULT NULL COMMENT 'Discount Tax Compensation Amount',
  `base_discount_tax_compensation_amount` decimal(20,4) DEFAULT NULL COMMENT 'Base Discount Tax Compensation Amount',
  `discount_tax_compensation_invoiced` decimal(20,4) DEFAULT NULL COMMENT 'Discount Tax Compensation Invoiced',
  `base_discount_tax_compensation_invoiced` decimal(20,4) DEFAULT NULL COMMENT 'Base Discount Tax Compensation Invoiced',
  `discount_tax_compensation_refunded` decimal(20,4) DEFAULT NULL COMMENT 'Discount Tax Compensation Refunded',
  `base_discount_tax_compensation_refunded` decimal(20,4) DEFAULT NULL COMMENT 'Base Discount Tax Compensation Refunded',
  `tax_canceled` decimal(12,4) DEFAULT NULL COMMENT 'Tax Canceled',
  `discount_tax_compensation_canceled` decimal(20,4) DEFAULT NULL COMMENT 'Discount Tax Compensation Canceled',
  `tax_refunded` decimal(20,4) DEFAULT NULL COMMENT 'Tax Refunded',
  `base_tax_refunded` decimal(20,4) DEFAULT NULL COMMENT 'Base Tax Refunded',
  `discount_refunded` decimal(20,4) DEFAULT NULL COMMENT 'Discount Refunded',
  `base_discount_refunded` decimal(20,4) DEFAULT NULL COMMENT 'Base Discount Refunded',
  `gift_message_id` int DEFAULT NULL COMMENT 'Gift Message ID',
  `gift_message_available` int DEFAULT NULL COMMENT 'Gift Message Available',
  `free_shipping` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Free Shipping',
  `weee_tax_applied` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Weee Tax Applied',
  `weee_tax_applied_amount` decimal(12,4) DEFAULT NULL COMMENT 'Weee Tax Applied Amount',
  `weee_tax_applied_row_amount` decimal(12,4) DEFAULT NULL COMMENT 'Weee Tax Applied Row Amount',
  `weee_tax_disposition` decimal(12,4) DEFAULT NULL COMMENT 'Weee Tax Disposition',
  `weee_tax_row_disposition` decimal(12,4) DEFAULT NULL COMMENT 'Weee Tax Row Disposition',
  `base_weee_tax_applied_amount` decimal(12,4) DEFAULT NULL COMMENT 'Base Weee Tax Applied Amount',
  `base_weee_tax_applied_row_amnt` decimal(12,4) DEFAULT NULL COMMENT 'Base Weee Tax Applied Row Amnt',
  `base_weee_tax_disposition` decimal(12,4) DEFAULT NULL COMMENT 'Base Weee Tax Disposition',
  `base_weee_tax_row_disposition` decimal(12,4) DEFAULT NULL COMMENT 'Base Weee Tax Row Disposition',
  PRIMARY KEY (`item_id`),
  KEY `[[DBPREFIX]]SALES_ORDER_ITEM_ORDER_ID` (`order_id`),
  KEY `[[DBPREFIX]]SALES_ORDER_ITEM_STORE_ID` (`store_id`),
  CONSTRAINT `[[DBPREFIX]]SALES_ORDER_ITEM_ORDER_ID_[[DBPREFIX]]SALES_ORDER_ENTITY_ID` FOREIGN KEY (`order_id`) REFERENCES `[[dbprefix]]sales_order` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]SALES_ORDER_ITEM_STORE_ID_[[DBPREFIX]]STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Flat Order Item';

--
-- Dumping data for table `[[dbprefix]]sales_order_item`
--


--
-- Table structure for table `[[dbprefix]]sales_order_payment`
--

CREATE TABLE `[[dbprefix]]sales_order_payment` (
  `entity_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `parent_id` int unsigned NOT NULL COMMENT 'Parent ID',
  `base_shipping_captured` decimal(20,4) DEFAULT NULL COMMENT 'Base Shipping Captured',
  `shipping_captured` decimal(20,4) DEFAULT NULL COMMENT 'Shipping Captured',
  `amount_refunded` decimal(20,4) DEFAULT NULL COMMENT 'Amount Refunded',
  `base_amount_paid` decimal(20,4) DEFAULT NULL COMMENT 'Base Amount Paid',
  `amount_canceled` decimal(20,4) DEFAULT NULL COMMENT 'Amount Canceled',
  `base_amount_authorized` decimal(20,4) DEFAULT NULL COMMENT 'Base Amount Authorized',
  `base_amount_paid_online` decimal(20,4) DEFAULT NULL COMMENT 'Base Amount Paid Online',
  `base_amount_refunded_online` decimal(20,4) DEFAULT NULL COMMENT 'Base Amount Refunded Online',
  `base_shipping_amount` decimal(20,4) DEFAULT NULL COMMENT 'Base Shipping Amount',
  `shipping_amount` decimal(20,4) DEFAULT NULL COMMENT 'Shipping Amount',
  `amount_paid` decimal(20,4) DEFAULT NULL COMMENT 'Amount Paid',
  `amount_authorized` decimal(20,4) DEFAULT NULL COMMENT 'Amount Authorized',
  `base_amount_ordered` decimal(20,4) DEFAULT NULL COMMENT 'Base Amount Ordered',
  `base_shipping_refunded` decimal(20,4) DEFAULT NULL COMMENT 'Base Shipping Refunded',
  `shipping_refunded` decimal(20,4) DEFAULT NULL COMMENT 'Shipping Refunded',
  `base_amount_refunded` decimal(20,4) DEFAULT NULL COMMENT 'Base Amount Refunded',
  `amount_ordered` decimal(20,4) DEFAULT NULL COMMENT 'Amount Ordered',
  `base_amount_canceled` decimal(20,4) DEFAULT NULL COMMENT 'Base Amount Canceled',
  `quote_payment_id` int DEFAULT NULL COMMENT 'Quote Payment ID',
  `additional_data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Additional Data',
  `cc_exp_month` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Cc Exp Month',
  `cc_ss_start_year` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Cc Ss Start Year',
  `echeck_bank_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Echeck Bank Name',
  `method` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Method',
  `cc_debug_request_body` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Cc Debug Request Body',
  `cc_secure_verify` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Cc Secure Verify',
  `protection_eligibility` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Protection Eligibility',
  `cc_approval` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Cc Approval',
  `cc_last_4` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Cc Last 4',
  `cc_status_description` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Cc Status Description',
  `echeck_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Echeck Type',
  `cc_debug_response_serialized` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Cc Debug Response Serialized',
  `cc_ss_start_month` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Cc Ss Start Month',
  `echeck_account_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Echeck Account Type',
  `last_trans_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Last Trans ID',
  `cc_cid_status` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Cc Cid Status',
  `cc_owner` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Cc Owner',
  `cc_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Cc Type',
  `po_number` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Po Number',
  `cc_exp_year` varchar(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Cc Exp Year',
  `cc_status` varchar(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Cc Status',
  `echeck_routing_number` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Echeck Routing Number',
  `account_status` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Account Status',
  `anet_trans_method` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Anet Trans Method',
  `cc_debug_response_body` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Cc Debug Response Body',
  `cc_ss_issue` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Cc Ss Issue',
  `echeck_account_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Echeck Account Name',
  `cc_avs_status` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Cc Avs Status',
  `cc_number_enc` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `cc_trans_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Cc Trans ID',
  `address_status` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Address Status',
  `additional_information` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Additional Information',
  PRIMARY KEY (`entity_id`),
  KEY `[[DBPREFIX]]SALES_ORDER_PAYMENT_PARENT_ID` (`parent_id`),
  CONSTRAINT `[[DBPREFIX]]SALES_ORDER_PAYMENT_PARENT_ID_[[DBPREFIX]]SALES_ORDER_ENTITY_ID` FOREIGN KEY (`parent_id`) REFERENCES `[[dbprefix]]sales_order` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Flat Order Payment';

--
-- Dumping data for table `[[dbprefix]]sales_order_payment`
--


--
-- Table structure for table `[[dbprefix]]sales_order_status`
--

CREATE TABLE `[[dbprefix]]sales_order_status` (
  `status` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Status',
  `label` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Label',
  PRIMARY KEY (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Order Status Table';

--
-- Dumping data for table `[[dbprefix]]sales_order_status`
--

INSERT INTO `[[dbprefix]]sales_order_status` VALUES ('canceled','Canceled'),('closed','Closed'),('complete','Complete'),('fraud','Suspected Fraud'),('holded','On Hold'),('payment_review','Payment Review'),('paypal_canceled_reversal','PayPal Canceled Reversal'),('paypal_reversed','PayPal Reversed'),('pending','Pending'),('pending_payment','Pending Payment'),('pending_paypal','Pending PayPal'),('processing','Processing');

--
-- Table structure for table `[[dbprefix]]sales_order_status_change_history`
--

CREATE TABLE `[[dbprefix]]sales_order_status_change_history` (
  `entity_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `order_id` int unsigned NOT NULL COMMENT 'Order ID',
  `status` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Order Status',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Order status updated at',
  PRIMARY KEY (`entity_id`),
  KEY `FK_DA8CBD7803251060EDE247D400FBBD93` (`order_id`),
  CONSTRAINT `FK_DA8CBD7803251060EDE247D400FBBD93` FOREIGN KEY (`order_id`) REFERENCES `[[dbprefix]]sales_order` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Save the updated order status with timestamp';

--
-- Dumping data for table `[[dbprefix]]sales_order_status_change_history`
--


--
-- Table structure for table `[[dbprefix]]sales_order_status_data_exporter_cl`
--

CREATE TABLE `[[dbprefix]]sales_order_status_data_exporter_cl` (
  `version_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Version ID',
  `entity_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'Order status',
  PRIMARY KEY (`version_id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COMMENT='[[dbprefix]]sales_order_status_data_exporter_cl';

--
-- Dumping data for table `[[dbprefix]]sales_order_status_data_exporter_cl`
--

INSERT INTO `[[dbprefix]]sales_order_status_data_exporter_cl` VALUES (1,'pending'),(2,'pending_payment'),(3,'processing'),(4,'holded'),(5,'complete'),(6,'closed'),(7,'canceled'),(8,'fraud'),(9,'payment_review'),(10,'pending_paypal'),(11,'paypal_reversed'),(12,'paypal_canceled_reversal');

--
-- Table structure for table `[[dbprefix]]sales_order_status_history`
--

CREATE TABLE `[[dbprefix]]sales_order_status_history` (
  `entity_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `parent_id` int unsigned NOT NULL COMMENT 'Parent ID',
  `is_customer_notified` int DEFAULT NULL COMMENT 'Is Customer Notified',
  `is_visible_on_front` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Is Visible On Front',
  `comment` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Comment',
  `status` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Status',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Created At',
  `entity_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Shows what entity history is bind to.',
  PRIMARY KEY (`entity_id`),
  KEY `[[DBPREFIX]]SALES_ORDER_STATUS_HISTORY_PARENT_ID` (`parent_id`),
  KEY `[[DBPREFIX]]SALES_ORDER_STATUS_HISTORY_CREATED_AT` (`created_at`),
  CONSTRAINT `[[DBPREFIX]]SALES_ORDER_STS_HISTORY_PARENT_ID_[[DBPREFIX]]SALES_ORDER_ENTT_ID` FOREIGN KEY (`parent_id`) REFERENCES `[[dbprefix]]sales_order` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Flat Order Status History';

--
-- Dumping data for table `[[dbprefix]]sales_order_status_history`
--


--
-- Table structure for table `[[dbprefix]]sales_order_status_label`
--

CREATE TABLE `[[dbprefix]]sales_order_status_label` (
  `status` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Status',
  `store_id` smallint unsigned NOT NULL COMMENT 'Store ID',
  `label` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Label',
  PRIMARY KEY (`status`,`store_id`),
  KEY `[[DBPREFIX]]SALES_ORDER_STATUS_LABEL_STORE_ID` (`store_id`),
  CONSTRAINT `[[DBPREFIX]]SALES_ORDER_STATUS_LABEL_STORE_ID_[[DBPREFIX]]STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]SALES_ORDER_STS_LBL_STS_[[DBPREFIX]]SALES_ORDER_STS_STS` FOREIGN KEY (`status`) REFERENCES `[[dbprefix]]sales_order_status` (`status`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Order Status Label Table';

--
-- Dumping data for table `[[dbprefix]]sales_order_status_label`
--


--
-- Table structure for table `[[dbprefix]]sales_order_status_state`
--

CREATE TABLE `[[dbprefix]]sales_order_status_state` (
  `status` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Status',
  `state` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Label',
  `is_default` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Is Default',
  `visible_on_front` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Visible on front',
  PRIMARY KEY (`status`,`state`),
  CONSTRAINT `[[DBPREFIX]]SALES_ORDER_STS_STATE_STS_[[DBPREFIX]]SALES_ORDER_STS_STS` FOREIGN KEY (`status`) REFERENCES `[[dbprefix]]sales_order_status` (`status`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Order Status Table';

--
-- Dumping data for table `[[dbprefix]]sales_order_status_state`
--

INSERT INTO `[[dbprefix]]sales_order_status_state` VALUES ('canceled','canceled',1,1),('closed','closed',1,1),('complete','complete',1,1),('fraud','payment_review',0,1),('fraud','processing',0,1),('holded','holded',1,1),('payment_review','payment_review',1,1),('pending','new',1,1),('pending_payment','pending_payment',1,0),('processing','processing',1,1);

--
-- Table structure for table `[[dbprefix]]sales_order_tax`
--

CREATE TABLE `[[dbprefix]]sales_order_tax` (
  `tax_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Tax ID',
  `order_id` int unsigned NOT NULL COMMENT 'Order ID',
  `code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Code',
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Title',
  `percent` decimal(12,4) DEFAULT NULL COMMENT 'Percent',
  `amount` decimal(20,4) DEFAULT NULL COMMENT 'Amount',
  `priority` int NOT NULL COMMENT 'Priority',
  `position` int NOT NULL COMMENT 'Position',
  `base_amount` decimal(20,4) DEFAULT NULL COMMENT 'Base Amount',
  `process` smallint NOT NULL COMMENT 'Process',
  `base_real_amount` decimal(20,4) DEFAULT NULL COMMENT 'Base Real Amount',
  PRIMARY KEY (`tax_id`),
  KEY `[[DBPREFIX]]SALES_ORDER_TAX_ORDER_ID_PRIORITY_POSITION` (`order_id`,`priority`,`position`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Order Tax Table';

--
-- Dumping data for table `[[dbprefix]]sales_order_tax`
--


--
-- Table structure for table `[[dbprefix]]sales_order_tax_item`
--

CREATE TABLE `[[dbprefix]]sales_order_tax_item` (
  `tax_item_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Tax Item ID',
  `tax_id` int unsigned NOT NULL COMMENT 'Tax ID',
  `item_id` int unsigned DEFAULT NULL COMMENT 'Item ID',
  `tax_percent` decimal(12,4) NOT NULL COMMENT 'Real Tax Percent For Item',
  `amount` decimal(20,4) NOT NULL COMMENT 'Tax amount for the item and tax rate',
  `base_amount` decimal(20,4) NOT NULL COMMENT 'Base tax amount for the item and tax rate',
  `real_amount` decimal(20,4) NOT NULL COMMENT 'Real tax amount for the item and tax rate',
  `real_base_amount` decimal(20,4) NOT NULL COMMENT 'Real base tax amount for the item and tax rate',
  `associated_item_id` int unsigned DEFAULT NULL COMMENT 'Id of the associated item',
  `taxable_item_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Type of the taxable item',
  PRIMARY KEY (`tax_item_id`),
  UNIQUE KEY `[[DBPREFIX]]SALES_ORDER_TAX_ITEM_TAX_ID_ITEM_ID` (`tax_id`,`item_id`),
  KEY `FK_C5158D2E6E4CE4AE5A4588108F277924` (`associated_item_id`),
  KEY `[[DBPREFIX]]SALES_ORDER_TAX_ITEM_ITEM_ID` (`item_id`),
  CONSTRAINT `FK_C5158D2E6E4CE4AE5A4588108F277924` FOREIGN KEY (`associated_item_id`) REFERENCES `[[dbprefix]]sales_order_item` (`item_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]SALES_ORDER_TAX_ITEM_ITEM_ID_[[DBPREFIX]]SALES_ORDER_ITEM_ITEM_ID` FOREIGN KEY (`item_id`) REFERENCES `[[dbprefix]]sales_order_item` (`item_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]SALES_ORDER_TAX_ITEM_TAX_ID_[[DBPREFIX]]SALES_ORDER_TAX_TAX_ID` FOREIGN KEY (`tax_id`) REFERENCES `[[dbprefix]]sales_order_tax` (`tax_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Order Tax Item';

--
-- Dumping data for table `[[dbprefix]]sales_order_tax_item`
--


--
-- Table structure for table `[[dbprefix]]sales_payment_transaction`
--

CREATE TABLE `[[dbprefix]]sales_payment_transaction` (
  `transaction_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Transaction ID',
  `parent_id` int unsigned DEFAULT NULL COMMENT 'Parent ID',
  `order_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Order ID',
  `payment_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Payment ID',
  `txn_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Txn ID',
  `parent_txn_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Parent Txn ID',
  `txn_type` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Txn Type',
  `is_closed` smallint unsigned NOT NULL DEFAULT '1' COMMENT 'Is Closed',
  `additional_information` blob COMMENT 'Additional Information',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Created At',
  PRIMARY KEY (`transaction_id`),
  UNIQUE KEY `[[DBPREFIX]]SALES_PAYMENT_TRANSACTION_ORDER_ID_PAYMENT_ID_TXN_ID` (`order_id`,`payment_id`,`txn_id`),
  KEY `[[DBPREFIX]]SALES_PAYMENT_TRANSACTION_PARENT_ID` (`parent_id`),
  KEY `[[DBPREFIX]]SALES_PAYMENT_TRANSACTION_PAYMENT_ID` (`payment_id`),
  CONSTRAINT `FK_73B7F4264FB521058F4E709F99A54F3A` FOREIGN KEY (`parent_id`) REFERENCES `[[dbprefix]]sales_payment_transaction` (`transaction_id`) ON DELETE CASCADE,
  CONSTRAINT `FK_A76BCDC6CC14CF321955BB90C26EF2B1` FOREIGN KEY (`payment_id`) REFERENCES `[[dbprefix]]sales_order_payment` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]SALES_PAYMENT_TRANSACTION_ORDER_ID_[[DBPREFIX]]SALES_ORDER_ENTT_ID` FOREIGN KEY (`order_id`) REFERENCES `[[dbprefix]]sales_order` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Payment Transaction';

--
-- Dumping data for table `[[dbprefix]]sales_payment_transaction`
--


--
-- Table structure for table `[[dbprefix]]sales_refunded_aggregated`
--

CREATE TABLE `[[dbprefix]]sales_refunded_aggregated` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `period` date DEFAULT NULL COMMENT 'Period',
  `store_id` smallint unsigned DEFAULT NULL COMMENT 'Store ID',
  `order_status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Order Status',
  `orders_count` int NOT NULL DEFAULT '0' COMMENT 'Orders Count',
  `refunded` decimal(20,4) DEFAULT NULL COMMENT 'Refunded',
  `online_refunded` decimal(20,4) DEFAULT NULL COMMENT 'Online Refunded',
  `offline_refunded` decimal(20,4) DEFAULT NULL COMMENT 'Offline Refunded',
  PRIMARY KEY (`id`),
  UNIQUE KEY `[[DBPREFIX]]SALES_REFUNDED_AGGREGATED_PERIOD_STORE_ID_ORDER_STATUS` (`period`,`store_id`,`order_status`),
  KEY `[[DBPREFIX]]SALES_REFUNDED_AGGREGATED_STORE_ID` (`store_id`),
  CONSTRAINT `[[DBPREFIX]]SALES_REFUNDED_AGGREGATED_STORE_ID_[[DBPREFIX]]STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Refunded Aggregated';

--
-- Dumping data for table `[[dbprefix]]sales_refunded_aggregated`
--


--
-- Table structure for table `[[dbprefix]]sales_refunded_aggregated_order`
--

CREATE TABLE `[[dbprefix]]sales_refunded_aggregated_order` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `period` date DEFAULT NULL COMMENT 'Period',
  `store_id` smallint unsigned DEFAULT NULL COMMENT 'Store ID',
  `order_status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Order Status',
  `orders_count` int NOT NULL DEFAULT '0' COMMENT 'Orders Count',
  `refunded` decimal(20,4) DEFAULT NULL COMMENT 'Refunded',
  `online_refunded` decimal(20,4) DEFAULT NULL COMMENT 'Online Refunded',
  `offline_refunded` decimal(20,4) DEFAULT NULL COMMENT 'Offline Refunded',
  PRIMARY KEY (`id`),
  UNIQUE KEY `[[DBPREFIX]]SALES_REFUNDED_AGGRED_ORDER_PERIOD_STORE_ID_ORDER_STS` (`period`,`store_id`,`order_status`),
  KEY `[[DBPREFIX]]SALES_REFUNDED_AGGREGATED_ORDER_STORE_ID` (`store_id`),
  CONSTRAINT `[[DBPREFIX]]SALES_REFUNDED_AGGRED_ORDER_STORE_ID_[[DBPREFIX]]STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Refunded Aggregated Order';

--
-- Dumping data for table `[[dbprefix]]sales_refunded_aggregated_order`
--


--
-- Table structure for table `[[dbprefix]]sales_sequence_meta`
--

CREATE TABLE `[[dbprefix]]sales_sequence_meta` (
  `meta_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `entity_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Prefix',
  `store_id` smallint unsigned NOT NULL COMMENT 'Store ID',
  `sequence_table` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'table for sequence',
  PRIMARY KEY (`meta_id`),
  UNIQUE KEY `[[DBPREFIX]]SALES_SEQUENCE_META_ENTITY_TYPE_STORE_ID` (`entity_type`,`store_id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COMMENT='sales_sequence_meta';

--
-- Dumping data for table `[[dbprefix]]sales_sequence_meta`
--

INSERT INTO `[[dbprefix]]sales_sequence_meta` VALUES (1,'order',0,'[[dbprefix]]sequence_order_0'),(2,'invoice',0,'[[dbprefix]]sequence_invoice_0'),(3,'creditmemo',0,'[[dbprefix]]sequence_creditmemo_0'),(4,'shipment',0,'[[dbprefix]]sequence_shipment_0'),(5,'order',1,'[[dbprefix]]sequence_order_1'),(6,'invoice',1,'[[dbprefix]]sequence_invoice_1'),(7,'creditmemo',1,'[[dbprefix]]sequence_creditmemo_1'),(8,'shipment',1,'[[dbprefix]]sequence_shipment_1');

--
-- Table structure for table `[[dbprefix]]sales_sequence_profile`
--

CREATE TABLE `[[dbprefix]]sales_sequence_profile` (
  `profile_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `meta_id` int unsigned NOT NULL COMMENT 'Meta_id',
  `prefix` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Prefix',
  `suffix` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Suffix',
  `start_value` int unsigned NOT NULL DEFAULT '1' COMMENT 'Start value for sequence',
  `step` int unsigned NOT NULL DEFAULT '1' COMMENT 'Step for sequence',
  `max_value` int unsigned NOT NULL COMMENT 'MaxValue for sequence',
  `warning_value` int unsigned NOT NULL COMMENT 'WarningValue for sequence',
  `is_active` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'isActive flag',
  PRIMARY KEY (`profile_id`),
  UNIQUE KEY `[[DBPREFIX]]SALES_SEQUENCE_PROFILE_META_ID_PREFIX_SUFFIX` (`meta_id`,`prefix`,`suffix`),
  CONSTRAINT `FK_FF2697E40702A51DC607A883D7D1418F` FOREIGN KEY (`meta_id`) REFERENCES `[[dbprefix]]sales_sequence_meta` (`meta_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COMMENT='sales_sequence_profile';

--
-- Dumping data for table `[[dbprefix]]sales_sequence_profile`
--

INSERT INTO `[[dbprefix]]sales_sequence_profile` VALUES (1,1,NULL,NULL,1,1,4294967295,4294966295,1),(2,2,NULL,NULL,1,1,4294967295,4294966295,1),(3,3,NULL,NULL,1,1,4294967295,4294966295,1),(4,4,NULL,NULL,1,1,4294967295,4294966295,1),(5,5,NULL,NULL,1,1,4294967295,4294966295,1),(6,6,NULL,NULL,1,1,4294967295,4294966295,1),(7,7,NULL,NULL,1,1,4294967295,4294966295,1),(8,8,NULL,NULL,1,1,4294967295,4294966295,1);

--
-- Table structure for table `[[dbprefix]]sales_shipment`
--

CREATE TABLE `[[dbprefix]]sales_shipment` (
  `entity_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `store_id` smallint unsigned DEFAULT NULL COMMENT 'Store ID',
  `total_weight` decimal(12,4) DEFAULT NULL COMMENT 'Total Weight',
  `total_qty` decimal(12,4) DEFAULT NULL COMMENT 'Total Qty',
  `email_sent` smallint DEFAULT NULL COMMENT 'Email Sent',
  `send_email` smallint unsigned DEFAULT NULL COMMENT 'Send Email',
  `order_id` int unsigned NOT NULL COMMENT 'Order ID',
  `customer_id` int DEFAULT NULL COMMENT 'Customer ID',
  `shipping_address_id` int DEFAULT NULL COMMENT 'Shipping Address ID',
  `billing_address_id` int DEFAULT NULL COMMENT 'Billing Address ID',
  `shipment_status` int DEFAULT NULL COMMENT 'Shipment Status',
  `increment_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Increment ID',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Created At',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Updated At',
  `packages` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Packed Products in Packages',
  `shipping_label` mediumblob COMMENT 'Shipping Label Content',
  `customer_note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Customer Note',
  `customer_note_notify` smallint unsigned DEFAULT NULL COMMENT 'Customer Note Notify',
  PRIMARY KEY (`entity_id`),
  UNIQUE KEY `[[DBPREFIX]]SALES_SHIPMENT_INCREMENT_ID_STORE_ID` (`increment_id`,`store_id`),
  KEY `[[DBPREFIX]]SALES_SHIPMENT_STORE_ID` (`store_id`),
  KEY `[[DBPREFIX]]SALES_SHIPMENT_TOTAL_QTY` (`total_qty`),
  KEY `[[DBPREFIX]]SALES_SHIPMENT_ORDER_ID` (`order_id`),
  KEY `[[DBPREFIX]]SALES_SHIPMENT_CREATED_AT` (`created_at`),
  KEY `[[DBPREFIX]]SALES_SHIPMENT_UPDATED_AT` (`updated_at`),
  KEY `[[DBPREFIX]]SALES_SHIPMENT_SEND_EMAIL` (`send_email`),
  KEY `[[DBPREFIX]]SALES_SHIPMENT_EMAIL_SENT` (`email_sent`),
  CONSTRAINT `[[DBPREFIX]]SALES_SHIPMENT_ORDER_ID_[[DBPREFIX]]SALES_ORDER_ENTITY_ID` FOREIGN KEY (`order_id`) REFERENCES `[[dbprefix]]sales_order` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]SALES_SHIPMENT_STORE_ID_[[DBPREFIX]]STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Flat Shipment';

--
-- Dumping data for table `[[dbprefix]]sales_shipment`
--


--
-- Table structure for table `[[dbprefix]]sales_shipment_comment`
--

CREATE TABLE `[[dbprefix]]sales_shipment_comment` (
  `entity_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `parent_id` int unsigned NOT NULL COMMENT 'Parent ID',
  `is_customer_notified` int DEFAULT NULL COMMENT 'Is Customer Notified',
  `is_visible_on_front` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Is Visible On Front',
  `comment` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Comment',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Created At',
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Updated At',
  `user_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Admin User ID',
  `user_type` int unsigned NOT NULL DEFAULT '0' COMMENT 'User Type',
  PRIMARY KEY (`entity_id`),
  UNIQUE KEY `[[DBPREFIX]]SALES_SHIPMENT_COMMENT_ENTITY_ID_USER_ID_USER_TYPE` (`entity_id`,`user_id`,`user_type`),
  KEY `[[DBPREFIX]]SALES_SHIPMENT_COMMENT_CREATED_AT` (`created_at`),
  KEY `[[DBPREFIX]]SALES_SHIPMENT_COMMENT_PARENT_ID` (`parent_id`),
  CONSTRAINT `FK_189F8F82DC76F0FCED78AFF20039A3A2` FOREIGN KEY (`parent_id`) REFERENCES `[[dbprefix]]sales_shipment` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Flat Shipment Comment';

--
-- Dumping data for table `[[dbprefix]]sales_shipment_comment`
--


--
-- Table structure for table `[[dbprefix]]sales_shipment_grid`
--

CREATE TABLE `[[dbprefix]]sales_shipment_grid` (
  `entity_id` int unsigned NOT NULL COMMENT 'Entity ID',
  `increment_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Increment ID',
  `store_id` smallint unsigned DEFAULT NULL COMMENT 'Store ID',
  `order_increment_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Order Increment ID',
  `order_id` int unsigned NOT NULL COMMENT 'Order ID',
  `order_created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Order Increment ID',
  `customer_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Customer Name',
  `total_qty` decimal(12,4) DEFAULT NULL COMMENT 'Total Qty',
  `shipment_status` int DEFAULT NULL COMMENT 'Shipment Status',
  `order_status` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Order',
  `billing_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Billing Address',
  `shipping_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Shipping Address',
  `billing_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Billing Name',
  `shipping_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Shipping Name',
  `customer_email` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Customer Email',
  `customer_group_id` int DEFAULT NULL,
  `payment_method` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Payment Method',
  `shipping_information` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Shipping Method Name',
  `created_at` timestamp NULL DEFAULT NULL COMMENT 'Created At',
  `updated_at` timestamp NULL DEFAULT NULL COMMENT 'Updated At',
  PRIMARY KEY (`entity_id`),
  UNIQUE KEY `[[DBPREFIX]]SALES_SHIPMENT_GRID_INCREMENT_ID_STORE_ID` (`increment_id`,`store_id`),
  KEY `[[DBPREFIX]]SALES_SHIPMENT_GRID_STORE_ID` (`store_id`),
  KEY `[[DBPREFIX]]SALES_SHIPMENT_GRID_TOTAL_QTY` (`total_qty`),
  KEY `[[DBPREFIX]]SALES_SHIPMENT_GRID_ORDER_INCREMENT_ID` (`order_increment_id`),
  KEY `[[DBPREFIX]]SALES_SHIPMENT_GRID_SHIPMENT_STATUS` (`shipment_status`),
  KEY `[[DBPREFIX]]SALES_SHIPMENT_GRID_ORDER_STATUS` (`order_status`),
  KEY `[[DBPREFIX]]SALES_SHIPMENT_GRID_CREATED_AT` (`created_at`),
  KEY `[[DBPREFIX]]SALES_SHIPMENT_GRID_UPDATED_AT` (`updated_at`),
  KEY `[[DBPREFIX]]SALES_SHIPMENT_GRID_ORDER_CREATED_AT` (`order_created_at`),
  KEY `[[DBPREFIX]]SALES_SHIPMENT_GRID_SHIPPING_NAME` (`shipping_name`),
  KEY `[[DBPREFIX]]SALES_SHIPMENT_GRID_BILLING_NAME` (`billing_name`),
  KEY `[[DBPREFIX]]SALES_SHIPMENT_GRID_ORDER_ID` (`order_id`),
  FULLTEXT KEY `FTI_0660C059FCD64B594430BAD2A34B0BA9` (`increment_id`,`order_increment_id`,`shipping_name`,`customer_name`,`customer_email`,`billing_address`,`shipping_address`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Flat Shipment Grid';

--
-- Dumping data for table `[[dbprefix]]sales_shipment_grid`
--


--
-- Table structure for table `[[dbprefix]]sales_shipment_item`
--

CREATE TABLE `[[dbprefix]]sales_shipment_item` (
  `entity_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `parent_id` int unsigned NOT NULL COMMENT 'Parent ID',
  `row_total` decimal(20,4) DEFAULT NULL COMMENT 'Row Total',
  `price` decimal(20,4) DEFAULT NULL COMMENT 'Price',
  `weight` decimal(12,4) DEFAULT NULL COMMENT 'Weight',
  `qty` decimal(12,4) DEFAULT NULL COMMENT 'Qty',
  `product_id` int DEFAULT NULL COMMENT 'Product ID',
  `order_item_id` int DEFAULT NULL COMMENT 'Order Item ID',
  `additional_data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Additional Data',
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Description',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Name',
  `sku` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Sku',
  PRIMARY KEY (`entity_id`),
  KEY `[[DBPREFIX]]SALES_SHIPMENT_ITEM_PARENT_ID` (`parent_id`),
  CONSTRAINT `[[DBPREFIX]]SALES_SHIPMENT_ITEM_PARENT_ID_[[DBPREFIX]]SALES_SHIPMENT_ENTITY_ID` FOREIGN KEY (`parent_id`) REFERENCES `[[dbprefix]]sales_shipment` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Flat Shipment Item';

--
-- Dumping data for table `[[dbprefix]]sales_shipment_item`
--


--
-- Table structure for table `[[dbprefix]]sales_shipment_track`
--

CREATE TABLE `[[dbprefix]]sales_shipment_track` (
  `entity_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `parent_id` int unsigned NOT NULL COMMENT 'Parent ID',
  `weight` decimal(12,4) DEFAULT NULL COMMENT 'Weight',
  `qty` decimal(12,4) DEFAULT NULL COMMENT 'Qty',
  `order_id` int unsigned NOT NULL COMMENT 'Order ID',
  `track_number` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Number',
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Description',
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Title',
  `carrier_code` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Carrier Code',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Created At',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Updated At',
  PRIMARY KEY (`entity_id`),
  KEY `[[DBPREFIX]]SALES_SHIPMENT_TRACK_PARENT_ID` (`parent_id`),
  KEY `[[DBPREFIX]]SALES_SHIPMENT_TRACK_ORDER_ID` (`order_id`),
  KEY `[[DBPREFIX]]SALES_SHIPMENT_TRACK_CREATED_AT` (`created_at`),
  CONSTRAINT `[[DBPREFIX]]SALES_SHIPMENT_TRACK_PARENT_ID_[[DBPREFIX]]SALES_SHIPMENT_ENTT_ID` FOREIGN KEY (`parent_id`) REFERENCES `[[dbprefix]]sales_shipment` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Flat Shipment Track';

--
-- Dumping data for table `[[dbprefix]]sales_shipment_track`
--


--
-- Table structure for table `[[dbprefix]]sales_shipping_aggregated`
--

CREATE TABLE `[[dbprefix]]sales_shipping_aggregated` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `period` date DEFAULT NULL COMMENT 'Period',
  `store_id` smallint unsigned DEFAULT NULL COMMENT 'Store ID',
  `order_status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Order Status',
  `shipping_description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Shipping Description',
  `orders_count` int NOT NULL DEFAULT '0' COMMENT 'Orders Count',
  `total_shipping` decimal(20,4) DEFAULT NULL COMMENT 'Total Shipping',
  `total_shipping_actual` decimal(20,4) DEFAULT NULL COMMENT 'Total Shipping Actual',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNQ_9BA127FB00B9D4A14A37F6574D5E1628` (`period`,`store_id`,`order_status`,`shipping_description`),
  KEY `[[DBPREFIX]]SALES_SHIPPING_AGGREGATED_STORE_ID` (`store_id`),
  CONSTRAINT `[[DBPREFIX]]SALES_SHIPPING_AGGREGATED_STORE_ID_[[DBPREFIX]]STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Shipping Aggregated';

--
-- Dumping data for table `[[dbprefix]]sales_shipping_aggregated`
--


--
-- Table structure for table `[[dbprefix]]sales_shipping_aggregated_order`
--

CREATE TABLE `[[dbprefix]]sales_shipping_aggregated_order` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `period` date DEFAULT NULL COMMENT 'Period',
  `store_id` smallint unsigned DEFAULT NULL COMMENT 'Store ID',
  `order_status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Order Status',
  `shipping_description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Shipping Description',
  `orders_count` int NOT NULL DEFAULT '0' COMMENT 'Orders Count',
  `total_shipping` decimal(20,4) DEFAULT NULL COMMENT 'Total Shipping',
  `total_shipping_actual` decimal(20,4) DEFAULT NULL COMMENT 'Total Shipping Actual',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNQ_FFC00FD9A23ABEF57E740B0115D76980` (`period`,`store_id`,`order_status`,`shipping_description`),
  KEY `[[DBPREFIX]]SALES_SHIPPING_AGGREGATED_ORDER_STORE_ID` (`store_id`),
  CONSTRAINT `[[DBPREFIX]]SALES_SHPP_AGGRED_ORDER_STORE_ID_[[DBPREFIX]]STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Shipping Aggregated Order';

--
-- Dumping data for table `[[dbprefix]]sales_shipping_aggregated_order`
--


--
-- Table structure for table `[[dbprefix]]salesrule`
--

CREATE TABLE `[[dbprefix]]salesrule` (
  `rule_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Name',
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Description',
  `from_date` date DEFAULT NULL COMMENT 'From',
  `to_date` date DEFAULT NULL COMMENT 'To',
  `uses_per_customer` int NOT NULL DEFAULT '0' COMMENT 'Uses Per Customer',
  `is_active` smallint NOT NULL DEFAULT '0' COMMENT 'Is Active',
  `conditions_serialized` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Conditions Serialized',
  `actions_serialized` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Actions Serialized',
  `stop_rules_processing` smallint NOT NULL DEFAULT '1' COMMENT 'Stop Rules Processing',
  `is_advanced` smallint unsigned NOT NULL DEFAULT '1' COMMENT 'Is Advanced',
  `product_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Product Ids',
  `sort_order` int unsigned NOT NULL DEFAULT '0' COMMENT 'Sort Order',
  `simple_action` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Simple Action',
  `discount_amount` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Discount Amount',
  `discount_qty` decimal(12,4) DEFAULT NULL COMMENT 'Discount Qty',
  `discount_step` int unsigned NOT NULL DEFAULT '0' COMMENT 'Discount Step',
  `apply_to_shipping` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Apply To Shipping',
  `times_used` int NOT NULL DEFAULT '0' COMMENT 'Times Used',
  `is_rss` smallint NOT NULL DEFAULT '0' COMMENT 'Is Rss',
  `coupon_type` smallint unsigned NOT NULL DEFAULT '1' COMMENT 'Coupon Type',
  `use_auto_generation` smallint NOT NULL DEFAULT '0' COMMENT 'Use Auto Generation',
  `uses_per_coupon` int NOT NULL DEFAULT '0' COMMENT 'User Per Coupon',
  `simple_free_shipping` smallint unsigned DEFAULT NULL COMMENT 'Simple Free Shipping',
  PRIMARY KEY (`rule_id`),
  KEY `[[DBPREFIX]]SALESRULE_IS_ACTIVE_SORT_ORDER_TO_DATE_FROM_DATE` (`is_active`,`sort_order`,`to_date`,`from_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Salesrule';

--
-- Dumping data for table `[[dbprefix]]salesrule`
--


--
-- Table structure for table `[[dbprefix]]salesrule_coupon`
--

CREATE TABLE `[[dbprefix]]salesrule_coupon` (
  `coupon_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Coupon ID',
  `rule_id` int unsigned NOT NULL COMMENT 'Rule ID',
  `code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Code',
  `usage_limit` int unsigned DEFAULT NULL COMMENT 'Usage Limit',
  `usage_per_customer` int unsigned DEFAULT NULL COMMENT 'Usage Per Customer',
  `times_used` int unsigned NOT NULL DEFAULT '0' COMMENT 'Times Used',
  `expiration_date` datetime DEFAULT NULL COMMENT 'Expiration Date',
  `is_primary` smallint unsigned DEFAULT NULL COMMENT 'Is Primary',
  `created_at` timestamp NULL DEFAULT NULL COMMENT 'Coupon Code Creation Date',
  `type` smallint DEFAULT '0' COMMENT 'Coupon Code Type',
  PRIMARY KEY (`coupon_id`),
  UNIQUE KEY `[[DBPREFIX]]SALESRULE_COUPON_CODE` (`code`),
  UNIQUE KEY `[[DBPREFIX]]SALESRULE_COUPON_RULE_ID_IS_PRIMARY` (`rule_id`,`is_primary`),
  KEY `[[DBPREFIX]]SALESRULE_COUPON_RULE_ID` (`rule_id`),
  CONSTRAINT `[[DBPREFIX]]SALESRULE_COUPON_RULE_ID_[[DBPREFIX]]SALESRULE_RULE_ID` FOREIGN KEY (`rule_id`) REFERENCES `[[dbprefix]]salesrule` (`rule_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Salesrule Coupon';

--
-- Dumping data for table `[[dbprefix]]salesrule_coupon`
--


--
-- Table structure for table `[[dbprefix]]salesrule_coupon_aggregated`
--

CREATE TABLE `[[dbprefix]]salesrule_coupon_aggregated` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `period` date NOT NULL COMMENT 'Period',
  `store_id` smallint unsigned DEFAULT NULL COMMENT 'Store ID',
  `order_status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Order Status',
  `coupon_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Coupon Code',
  `coupon_uses` int NOT NULL DEFAULT '0' COMMENT 'Coupon Uses',
  `subtotal_amount` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Subtotal Amount',
  `discount_amount` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Discount Amount',
  `total_amount` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Amount',
  `subtotal_amount_actual` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Subtotal Amount Actual',
  `discount_amount_actual` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Discount Amount Actual',
  `total_amount_actual` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Amount Actual',
  `rule_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Rule Name',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNQ_CBEFEADB1C2A9B55DFAD3BE4F646432A` (`period`,`store_id`,`order_status`,`coupon_code`),
  KEY `[[DBPREFIX]]SALESRULE_COUPON_AGGREGATED_STORE_ID` (`store_id`),
  KEY `[[DBPREFIX]]SALESRULE_COUPON_AGGREGATED_RULE_NAME` (`rule_name`),
  CONSTRAINT `[[DBPREFIX]]SALESRULE_COUPON_AGGREGATED_STORE_ID_[[DBPREFIX]]STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Coupon Aggregated';

--
-- Dumping data for table `[[dbprefix]]salesrule_coupon_aggregated`
--


--
-- Table structure for table `[[dbprefix]]salesrule_coupon_aggregated_order`
--

CREATE TABLE `[[dbprefix]]salesrule_coupon_aggregated_order` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `period` date NOT NULL COMMENT 'Period',
  `store_id` smallint unsigned DEFAULT NULL COMMENT 'Store ID',
  `order_status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Order Status',
  `coupon_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Coupon Code',
  `coupon_uses` int NOT NULL DEFAULT '0' COMMENT 'Coupon Uses',
  `subtotal_amount` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Subtotal Amount',
  `discount_amount` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Discount Amount',
  `total_amount` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Amount',
  `rule_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Rule Name',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNQ_D1503F028B39D307208B5D4A55397962` (`period`,`store_id`,`order_status`,`coupon_code`),
  KEY `[[DBPREFIX]]SALESRULE_COUPON_AGGREGATED_ORDER_STORE_ID` (`store_id`),
  KEY `[[DBPREFIX]]SALESRULE_COUPON_AGGREGATED_ORDER_RULE_NAME` (`rule_name`),
  CONSTRAINT `[[DBPREFIX]]SALESRULE_COUPON_AGGRED_ORDER_STORE_ID_[[DBPREFIX]]STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Coupon Aggregated Order';

--
-- Dumping data for table `[[dbprefix]]salesrule_coupon_aggregated_order`
--


--
-- Table structure for table `[[dbprefix]]salesrule_coupon_aggregated_updated`
--

CREATE TABLE `[[dbprefix]]salesrule_coupon_aggregated_updated` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `period` date NOT NULL COMMENT 'Period',
  `store_id` smallint unsigned DEFAULT NULL COMMENT 'Store ID',
  `order_status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Order Status',
  `coupon_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Coupon Code',
  `coupon_uses` int NOT NULL DEFAULT '0' COMMENT 'Coupon Uses',
  `subtotal_amount` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Subtotal Amount',
  `discount_amount` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Discount Amount',
  `total_amount` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Amount',
  `subtotal_amount_actual` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Subtotal Amount Actual',
  `discount_amount_actual` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Discount Amount Actual',
  `total_amount_actual` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Amount Actual',
  `rule_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Rule Name',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNQ_9EAC53B231F77BB66B08377A38D018A0` (`period`,`store_id`,`order_status`,`coupon_code`),
  KEY `[[DBPREFIX]]SALESRULE_COUPON_AGGREGATED_UPDATED_STORE_ID` (`store_id`),
  KEY `[[DBPREFIX]]SALESRULE_COUPON_AGGREGATED_UPDATED_RULE_NAME` (`rule_name`),
  CONSTRAINT `FK_6C3A3678E3576613EF8DC515B44E3B30` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Salesrule Coupon Aggregated Updated';

--
-- Dumping data for table `[[dbprefix]]salesrule_coupon_aggregated_updated`
--


--
-- Table structure for table `[[dbprefix]]salesrule_coupon_usage`
--

CREATE TABLE `[[dbprefix]]salesrule_coupon_usage` (
  `coupon_id` int unsigned NOT NULL COMMENT 'Coupon ID',
  `customer_id` int unsigned NOT NULL COMMENT 'Customer ID',
  `times_used` int unsigned NOT NULL DEFAULT '0' COMMENT 'Times Used',
  PRIMARY KEY (`coupon_id`,`customer_id`),
  KEY `[[DBPREFIX]]SALESRULE_COUPON_USAGE_CUSTOMER_ID` (`customer_id`),
  CONSTRAINT `FK_6A5DE9DEF99C62F7A570746C7D477433` FOREIGN KEY (`coupon_id`) REFERENCES `[[dbprefix]]salesrule_coupon` (`coupon_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]SALESRULE_COUPON_USAGE_CSTR_ID_[[DBPREFIX]]CSTR_ENTT_ENTT_ID` FOREIGN KEY (`customer_id`) REFERENCES `[[dbprefix]]customer_entity` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Salesrule Coupon Usage';

--
-- Dumping data for table `[[dbprefix]]salesrule_coupon_usage`
--


--
-- Table structure for table `[[dbprefix]]salesrule_customer`
--

CREATE TABLE `[[dbprefix]]salesrule_customer` (
  `rule_customer_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Rule Customer ID',
  `rule_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Rule ID',
  `customer_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Customer ID',
  `times_used` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Times Used',
  PRIMARY KEY (`rule_customer_id`),
  KEY `[[DBPREFIX]]SALESRULE_CUSTOMER_RULE_ID_CUSTOMER_ID` (`rule_id`,`customer_id`),
  KEY `[[DBPREFIX]]SALESRULE_CUSTOMER_CUSTOMER_ID_RULE_ID` (`customer_id`,`rule_id`),
  CONSTRAINT `[[DBPREFIX]]SALESRULE_CSTR_CSTR_ID_[[DBPREFIX]]CSTR_ENTT_ENTT_ID` FOREIGN KEY (`customer_id`) REFERENCES `[[dbprefix]]customer_entity` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]SALESRULE_CUSTOMER_RULE_ID_[[DBPREFIX]]SALESRULE_RULE_ID` FOREIGN KEY (`rule_id`) REFERENCES `[[dbprefix]]salesrule` (`rule_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Salesrule Customer';

--
-- Dumping data for table `[[dbprefix]]salesrule_customer`
--


--
-- Table structure for table `[[dbprefix]]salesrule_customer_group`
--

CREATE TABLE `[[dbprefix]]salesrule_customer_group` (
  `rule_id` int unsigned NOT NULL COMMENT 'Rule ID',
  `customer_group_id` int unsigned NOT NULL COMMENT 'Customer Group ID',
  PRIMARY KEY (`rule_id`,`customer_group_id`),
  KEY `[[DBPREFIX]]SALESRULE_CUSTOMER_GROUP_CUSTOMER_GROUP_ID` (`customer_group_id`),
  CONSTRAINT `FK_F599EAF5E3C8694AB0B05FD19A9F7C41` FOREIGN KEY (`customer_group_id`) REFERENCES `[[dbprefix]]customer_group` (`customer_group_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]SALESRULE_CUSTOMER_GROUP_RULE_ID_[[DBPREFIX]]SALESRULE_RULE_ID` FOREIGN KEY (`rule_id`) REFERENCES `[[dbprefix]]salesrule` (`rule_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Rules To Customer Groups Relations';

--
-- Dumping data for table `[[dbprefix]]salesrule_customer_group`
--


--
-- Table structure for table `[[dbprefix]]salesrule_label`
--

CREATE TABLE `[[dbprefix]]salesrule_label` (
  `label_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Label ID',
  `rule_id` int unsigned NOT NULL COMMENT 'Rule ID',
  `store_id` smallint unsigned NOT NULL COMMENT 'Store ID',
  `label` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Label',
  PRIMARY KEY (`label_id`),
  UNIQUE KEY `[[DBPREFIX]]SALESRULE_LABEL_RULE_ID_STORE_ID` (`rule_id`,`store_id`),
  KEY `[[DBPREFIX]]SALESRULE_LABEL_STORE_ID` (`store_id`),
  CONSTRAINT `[[DBPREFIX]]SALESRULE_LABEL_RULE_ID_[[DBPREFIX]]SALESRULE_RULE_ID` FOREIGN KEY (`rule_id`) REFERENCES `[[dbprefix]]salesrule` (`rule_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]SALESRULE_LABEL_STORE_ID_[[DBPREFIX]]STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Salesrule Label';

--
-- Dumping data for table `[[dbprefix]]salesrule_label`
--


--
-- Table structure for table `[[dbprefix]]salesrule_product_attribute`
--

CREATE TABLE `[[dbprefix]]salesrule_product_attribute` (
  `rule_id` int unsigned NOT NULL COMMENT 'Rule ID',
  `website_id` smallint unsigned NOT NULL COMMENT 'Website ID',
  `customer_group_id` int unsigned NOT NULL COMMENT 'Customer Group ID',
  `attribute_id` smallint unsigned NOT NULL COMMENT 'Attribute ID',
  PRIMARY KEY (`rule_id`,`website_id`,`customer_group_id`,`attribute_id`),
  KEY `[[DBPREFIX]]SALESRULE_PRODUCT_ATTRIBUTE_WEBSITE_ID` (`website_id`),
  KEY `[[DBPREFIX]]SALESRULE_PRODUCT_ATTRIBUTE_CUSTOMER_GROUP_ID` (`customer_group_id`),
  KEY `[[DBPREFIX]]SALESRULE_PRODUCT_ATTRIBUTE_ATTRIBUTE_ID` (`attribute_id`),
  CONSTRAINT `FK_5C6FB5B778D1DB61AA765B7085E71E13` FOREIGN KEY (`customer_group_id`) REFERENCES `[[dbprefix]]customer_group` (`customer_group_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]SALESRULE_PRD_ATTR_ATTR_ID_[[DBPREFIX]]EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `[[dbprefix]]eav_attribute` (`attribute_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]SALESRULE_PRD_ATTR_WS_ID_[[DBPREFIX]]STORE_WS_WS_ID` FOREIGN KEY (`website_id`) REFERENCES `[[dbprefix]]store_website` (`website_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]SALESRULE_PRODUCT_ATTRIBUTE_RULE_ID_[[DBPREFIX]]SALESRULE_RULE_ID` FOREIGN KEY (`rule_id`) REFERENCES `[[dbprefix]]salesrule` (`rule_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Salesrule Product Attribute';

--
-- Dumping data for table `[[dbprefix]]salesrule_product_attribute`
--


--
-- Table structure for table `[[dbprefix]]salesrule_website`
--

CREATE TABLE `[[dbprefix]]salesrule_website` (
  `rule_id` int unsigned NOT NULL COMMENT 'Rule ID',
  `website_id` smallint unsigned NOT NULL COMMENT 'Website ID',
  PRIMARY KEY (`rule_id`,`website_id`),
  KEY `[[DBPREFIX]]SALESRULE_WEBSITE_WEBSITE_ID` (`website_id`),
  CONSTRAINT `[[DBPREFIX]]SALESRULE_WEBSITE_RULE_ID_[[DBPREFIX]]SALESRULE_RULE_ID` FOREIGN KEY (`rule_id`) REFERENCES `[[dbprefix]]salesrule` (`rule_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]SALESRULE_WEBSITE_WEBSITE_ID_[[DBPREFIX]]STORE_WEBSITE_WEBSITE_ID` FOREIGN KEY (`website_id`) REFERENCES `[[dbprefix]]store_website` (`website_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Sales Rules To Websites Relations';

--
-- Dumping data for table `[[dbprefix]]salesrule_website`
--


--
-- Table structure for table `[[dbprefix]]search_query`
--

CREATE TABLE `[[dbprefix]]search_query` (
  `query_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Query ID',
  `query_text` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Query text',
  `num_results` int unsigned NOT NULL DEFAULT '0' COMMENT 'Num results',
  `popularity` int unsigned NOT NULL DEFAULT '0' COMMENT 'Popularity',
  `redirect` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Redirect',
  `store_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Store ID',
  `display_in_terms` smallint NOT NULL DEFAULT '1' COMMENT 'Display in terms',
  `is_active` smallint DEFAULT '1' COMMENT 'Active status',
  `is_processed` smallint DEFAULT '0' COMMENT 'Processed status',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Updated at',
  PRIMARY KEY (`query_id`),
  UNIQUE KEY `[[DBPREFIX]]SEARCH_QUERY_QUERY_TEXT_STORE_ID` (`query_text`,`store_id`),
  KEY `[[DBPREFIX]]SEARCH_QUERY_IS_PROCESSED` (`is_processed`),
  KEY `[[DBPREFIX]]SEARCH_QUERY_STORE_ID_NUM_RESULTS_POPULARITY` (`store_id`,`num_results`,`popularity`),
  KEY `[[DBPREFIX]]SEARCH_QUERY_QUERY_TEXT_STORE_ID_NUM_RESULTS_POPULARITY` (`query_text`,`store_id`,`num_results`,`popularity`),
  CONSTRAINT `[[DBPREFIX]]SEARCH_QUERY_STORE_ID_[[DBPREFIX]]STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Search query table';

--
-- Dumping data for table `[[dbprefix]]search_query`
--


--
-- Table structure for table `[[dbprefix]]search_synonyms`
--

CREATE TABLE `[[dbprefix]]search_synonyms` (
  `group_id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'Synonyms Group ID',
  `synonyms` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'list of synonyms making up this group',
  `store_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Store ID - identifies the store view these synonyms belong to',
  `website_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Website ID - identifies the website ID these synonyms belong to',
  PRIMARY KEY (`group_id`),
  KEY `[[DBPREFIX]]SEARCH_SYNONYMS_STORE_ID` (`store_id`),
  KEY `[[DBPREFIX]]SEARCH_SYNONYMS_WEBSITE_ID` (`website_id`),
  FULLTEXT KEY `[[DBPREFIX]]SEARCH_SYNONYMS_SYNONYMS` (`synonyms`),
  CONSTRAINT `[[DBPREFIX]]SEARCH_SYNONYMS_STORE_ID_[[DBPREFIX]]STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]SEARCH_SYNONYMS_WEBSITE_ID_[[DBPREFIX]]STORE_WEBSITE_WEBSITE_ID` FOREIGN KEY (`website_id`) REFERENCES `[[dbprefix]]store_website` (`website_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='table storing various synonyms groups';

--
-- Dumping data for table `[[dbprefix]]search_synonyms`
--


--
-- Table structure for table `[[dbprefix]]sendfriend_log`
--

CREATE TABLE `[[dbprefix]]sendfriend_log` (
  `log_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Log ID',
  `ip` bigint unsigned NOT NULL DEFAULT '0' COMMENT 'Customer IP address',
  `time` int unsigned NOT NULL DEFAULT '0' COMMENT 'Log time',
  `website_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Website ID',
  PRIMARY KEY (`log_id`),
  KEY `[[DBPREFIX]]SENDFRIEND_LOG_IP` (`ip`),
  KEY `[[DBPREFIX]]SENDFRIEND_LOG_TIME` (`time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Send to friend function log storage table';

--
-- Dumping data for table `[[dbprefix]]sendfriend_log`
--


--
-- Table structure for table `[[dbprefix]]sequence_creditmemo_0`
--

CREATE TABLE `[[dbprefix]]sequence_creditmemo_0` (
  `sequence_value` int unsigned NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`sequence_value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `[[dbprefix]]sequence_creditmemo_0`
--


--
-- Table structure for table `[[dbprefix]]sequence_creditmemo_1`
--

CREATE TABLE `[[dbprefix]]sequence_creditmemo_1` (
  `sequence_value` int unsigned NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`sequence_value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `[[dbprefix]]sequence_creditmemo_1`
--


--
-- Table structure for table `[[dbprefix]]sequence_invoice_0`
--

CREATE TABLE `[[dbprefix]]sequence_invoice_0` (
  `sequence_value` int unsigned NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`sequence_value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `[[dbprefix]]sequence_invoice_0`
--


--
-- Table structure for table `[[dbprefix]]sequence_invoice_1`
--

CREATE TABLE `[[dbprefix]]sequence_invoice_1` (
  `sequence_value` int unsigned NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`sequence_value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `[[dbprefix]]sequence_invoice_1`
--


--
-- Table structure for table `[[dbprefix]]sequence_order_0`
--

CREATE TABLE `[[dbprefix]]sequence_order_0` (
  `sequence_value` int unsigned NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`sequence_value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `[[dbprefix]]sequence_order_0`
--


--
-- Table structure for table `[[dbprefix]]sequence_order_1`
--

CREATE TABLE `[[dbprefix]]sequence_order_1` (
  `sequence_value` int unsigned NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`sequence_value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `[[dbprefix]]sequence_order_1`
--


--
-- Table structure for table `[[dbprefix]]sequence_shipment_0`
--

CREATE TABLE `[[dbprefix]]sequence_shipment_0` (
  `sequence_value` int unsigned NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`sequence_value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `[[dbprefix]]sequence_shipment_0`
--


--
-- Table structure for table `[[dbprefix]]sequence_shipment_1`
--

CREATE TABLE `[[dbprefix]]sequence_shipment_1` (
  `sequence_value` int unsigned NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`sequence_value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `[[dbprefix]]sequence_shipment_1`
--


--
-- Table structure for table `[[dbprefix]]session`
--

CREATE TABLE `[[dbprefix]]session` (
  `session_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Session Id',
  `session_expires` int unsigned NOT NULL DEFAULT '0' COMMENT 'Date of Session Expiration',
  `session_data` mediumblob NOT NULL COMMENT 'Session Data',
  PRIMARY KEY (`session_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Database Sessions Storage';

--
-- Dumping data for table `[[dbprefix]]session`
--


--
-- Table structure for table `[[dbprefix]]setup_module`
--

CREATE TABLE `[[dbprefix]]setup_module` (
  `module` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Module',
  `schema_version` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Schema Version',
  `data_version` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Data Version',
  PRIMARY KEY (`module`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Module versions registry';

--
-- Dumping data for table `[[dbprefix]]setup_module`
--

INSERT INTO `[[dbprefix]]setup_module` VALUES ('Magento_DataExporter','42.0.1','42.0.1'),('Magento_PageBuilderImageAttribute','1.0.0','1.0.0'),('Magento_QueryXml','42.0.0','42.0.0'),('Magento_Securitytxt','1.0.0','1.0.0'),('Magento_ServicesConnector','1.1.0','1.1.0'),('Magento_ServicesId','1.1.0','1.1.0'),('Magento_ServicesIdLayout','1.0.0','1.0.0'),('PayPal_Braintree','4.6.1','4.6.1');

--
-- Table structure for table `[[dbprefix]]shipping_tablerate`
--

CREATE TABLE `[[dbprefix]]shipping_tablerate` (
  `pk` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Primary key',
  `website_id` int NOT NULL DEFAULT '0' COMMENT 'Website ID',
  `dest_country_id` varchar(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT 'Destination coutry ISO/2 or ISO/3 code',
  `dest_region_id` int NOT NULL DEFAULT '0' COMMENT 'Destination Region ID',
  `dest_zip` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '*' COMMENT 'Destination Post Code (Zip)',
  `condition_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Rate Condition name',
  `condition_value` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Rate condition value',
  `price` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Price',
  `cost` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Cost',
  PRIMARY KEY (`pk`),
  UNIQUE KEY `UNQ_50E5FB6F6AB78252AFB1BF28E771F980` (`website_id`,`dest_country_id`,`dest_region_id`,`dest_zip`,`condition_name`,`condition_value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Shipping Tablerate';

--
-- Dumping data for table `[[dbprefix]]shipping_tablerate`
--


--
-- Table structure for table `[[dbprefix]]sitemap`
--

CREATE TABLE `[[dbprefix]]sitemap` (
  `sitemap_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Sitemap ID',
  `sitemap_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Sitemap Type',
  `sitemap_filename` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Sitemap Filename',
  `sitemap_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Sitemap Path',
  `sitemap_time` timestamp NULL DEFAULT NULL COMMENT 'Sitemap Time',
  `store_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Store ID',
  PRIMARY KEY (`sitemap_id`),
  KEY `[[DBPREFIX]]SITEMAP_STORE_ID` (`store_id`),
  CONSTRAINT `[[DBPREFIX]]SITEMAP_STORE_ID_[[DBPREFIX]]STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='XML Sitemap';

--
-- Dumping data for table `[[dbprefix]]sitemap`
--


--
-- Table structure for table `[[dbprefix]]store`
--

CREATE TABLE `[[dbprefix]]store` (
  `store_id` smallint unsigned NOT NULL AUTO_INCREMENT COMMENT 'Store ID',
  `code` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Code',
  `website_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Website ID',
  `group_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Group ID',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Store Name',
  `sort_order` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Store Sort Order',
  `is_active` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Store Activity',
  PRIMARY KEY (`store_id`),
  UNIQUE KEY `[[DBPREFIX]]STORE_CODE` (`code`),
  KEY `[[DBPREFIX]]STORE_WEBSITE_ID` (`website_id`),
  KEY `[[DBPREFIX]]STORE_IS_ACTIVE_SORT_ORDER` (`is_active`,`sort_order`),
  KEY `[[DBPREFIX]]STORE_GROUP_ID` (`group_id`),
  CONSTRAINT `[[DBPREFIX]]STORE_GROUP_ID_[[DBPREFIX]]STORE_GROUP_GROUP_ID` FOREIGN KEY (`group_id`) REFERENCES `[[dbprefix]]store_group` (`group_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]STORE_WEBSITE_ID_[[DBPREFIX]]STORE_WEBSITE_WEBSITE_ID` FOREIGN KEY (`website_id`) REFERENCES `[[dbprefix]]store_website` (`website_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='Stores';

--
-- Dumping data for table `[[dbprefix]]store`
--

INSERT INTO `[[dbprefix]]store` VALUES (0,'admin',0,0,'Admin',0,1),(1,'default',1,1,'Default Store View',0,1);

--
-- Table structure for table `[[dbprefix]]store_data_exporter_cl`
--

CREATE TABLE `[[dbprefix]]store_data_exporter_cl` (
  `version_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Version ID',
  `entity_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Entity ID',
  PRIMARY KEY (`version_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT='[[dbprefix]]store_data_exporter_cl';

--
-- Dumping data for table `[[dbprefix]]store_data_exporter_cl`
--

INSERT INTO `[[dbprefix]]store_data_exporter_cl` VALUES (1,0),(2,1);

--
-- Table structure for table `[[dbprefix]]store_group`
--

CREATE TABLE `[[dbprefix]]store_group` (
  `group_id` smallint unsigned NOT NULL AUTO_INCREMENT COMMENT 'Group ID',
  `website_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Website ID',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Store Group Name',
  `root_category_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Root Category ID',
  `default_store_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Default Store ID',
  `code` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Store group unique code',
  PRIMARY KEY (`group_id`),
  UNIQUE KEY `[[DBPREFIX]]STORE_GROUP_CODE` (`code`),
  KEY `[[DBPREFIX]]STORE_GROUP_WEBSITE_ID` (`website_id`),
  KEY `[[DBPREFIX]]STORE_GROUP_DEFAULT_STORE_ID` (`default_store_id`),
  CONSTRAINT `[[DBPREFIX]]STORE_GROUP_WEBSITE_ID_[[DBPREFIX]]STORE_WEBSITE_WEBSITE_ID` FOREIGN KEY (`website_id`) REFERENCES `[[dbprefix]]store_website` (`website_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='Store Groups';

--
-- Dumping data for table `[[dbprefix]]store_group`
--

INSERT INTO `[[dbprefix]]store_group` VALUES (0,0,'Default',0,0,'default'),(1,1,'Main Website Store',2,1,'main_website_store');

--
-- Table structure for table `[[dbprefix]]store_website`
--

CREATE TABLE `[[dbprefix]]store_website` (
  `website_id` smallint unsigned NOT NULL AUTO_INCREMENT COMMENT 'Website ID',
  `code` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Code',
  `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Website Name',
  `sort_order` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Sort Order',
  `default_group_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Default Group ID',
  `is_default` smallint unsigned DEFAULT '0' COMMENT 'Defines Is Website Default',
  PRIMARY KEY (`website_id`),
  UNIQUE KEY `[[DBPREFIX]]STORE_WEBSITE_CODE` (`code`),
  KEY `[[DBPREFIX]]STORE_WEBSITE_SORT_ORDER` (`sort_order`),
  KEY `[[DBPREFIX]]STORE_WEBSITE_DEFAULT_GROUP_ID` (`default_group_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='Websites';

--
-- Dumping data for table `[[dbprefix]]store_website`
--

INSERT INTO `[[dbprefix]]store_website` VALUES (0,'admin','Admin',0,0,0),(1,'base','Main Website',0,1,1);

--
-- Table structure for table `[[dbprefix]]stores_data_exporter`
--

CREATE TABLE `[[dbprefix]]stores_data_exporter` (
  `id` int unsigned NOT NULL COMMENT 'ID',
  `feed_data` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Feed Data',
  `modified_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Modified At',
  PRIMARY KEY (`id`),
  KEY `[[DBPREFIX]]STORES_DATA_EXPORTER_MODIFIED_AT` (`modified_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Stores Feed Storage';

--
-- Dumping data for table `[[dbprefix]]stores_data_exporter`
--

INSERT INTO `[[dbprefix]]stores_data_exporter` VALUES (1,'{\"store_view_id\":\"1\",\"store_id\":1,\"website_id\":1,\"store_view_name\":\"Default Store View\",\"store_name\":\"Main Website Store\",\"website_name\":\"Main Website\"}','[[regtime]]');

--
-- Table structure for table `[[dbprefix]]stores_data_exporter_index_batches`
--

CREATE TABLE `[[dbprefix]]stores_data_exporter_index_batches` (
  `batch_number` int NOT NULL COMMENT 'Batch Number',
  `website_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Website Id',
  PRIMARY KEY (`batch_number`,`website_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='[[dbprefix]]stores_data_exporter_index_batches';

--
-- Dumping data for table `[[dbprefix]]stores_data_exporter_index_batches`
--

INSERT INTO `[[dbprefix]]stores_data_exporter_index_batches` VALUES (1,1);

--
-- Table structure for table `[[dbprefix]]stores_data_exporter_index_sequence`
--

CREATE TABLE `[[dbprefix]]stores_data_exporter_index_sequence` (
  `i` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Auto Increment ID',
  PRIMARY KEY (`i`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT='[[dbprefix]]stores_data_exporter_index_sequence';

--
-- Dumping data for table `[[dbprefix]]stores_data_exporter_index_sequence`
--

INSERT INTO `[[dbprefix]]stores_data_exporter_index_sequence` VALUES (1),(2);

--
-- Table structure for table `[[dbprefix]]tax_calculation`
--

CREATE TABLE `[[dbprefix]]tax_calculation` (
  `tax_calculation_id` int NOT NULL AUTO_INCREMENT COMMENT 'Tax Calculation ID',
  `tax_calculation_rate_id` int NOT NULL COMMENT 'Tax Calculation Rate ID',
  `tax_calculation_rule_id` int NOT NULL COMMENT 'Tax Calculation Rule ID',
  `customer_tax_class_id` smallint NOT NULL COMMENT 'Customer Tax Class ID',
  `product_tax_class_id` smallint NOT NULL COMMENT 'Product Tax Class ID',
  PRIMARY KEY (`tax_calculation_id`),
  KEY `[[DBPREFIX]]TAX_CALCULATION_TAX_CALCULATION_RULE_ID` (`tax_calculation_rule_id`),
  KEY `[[DBPREFIX]]TAX_CALCULATION_CUSTOMER_TAX_CLASS_ID` (`customer_tax_class_id`),
  KEY `[[DBPREFIX]]TAX_CALCULATION_PRODUCT_TAX_CLASS_ID` (`product_tax_class_id`),
  KEY `IDX_DC62AA3A0515973AF9E40AD22777C73A` (`tax_calculation_rate_id`,`customer_tax_class_id`,`product_tax_class_id`),
  CONSTRAINT `FK_2B652BD3CC9AD34C7A2B33BAA2AB9BBB` FOREIGN KEY (`tax_calculation_rule_id`) REFERENCES `[[dbprefix]]tax_calculation_rule` (`tax_calculation_rule_id`) ON DELETE CASCADE,
  CONSTRAINT `FK_469DCE2C6AFE66A67F19F89821271A06` FOREIGN KEY (`tax_calculation_rate_id`) REFERENCES `[[dbprefix]]tax_calculation_rate` (`tax_calculation_rate_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]TAX_CALC_CSTR_TAX_CLASS_ID_[[DBPREFIX]]TAX_CLASS_CLASS_ID` FOREIGN KEY (`customer_tax_class_id`) REFERENCES `[[dbprefix]]tax_class` (`class_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]TAX_CALC_PRD_TAX_CLASS_ID_[[DBPREFIX]]TAX_CLASS_CLASS_ID` FOREIGN KEY (`product_tax_class_id`) REFERENCES `[[dbprefix]]tax_class` (`class_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Tax Calculation';

--
-- Dumping data for table `[[dbprefix]]tax_calculation`
--


--
-- Table structure for table `[[dbprefix]]tax_calculation_rate`
--

CREATE TABLE `[[dbprefix]]tax_calculation_rate` (
  `tax_calculation_rate_id` int NOT NULL AUTO_INCREMENT COMMENT 'Tax Calculation Rate ID',
  `tax_country_id` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Tax Country ID',
  `tax_region_id` int NOT NULL COMMENT 'Tax Region ID',
  `tax_postcode` varchar(21) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Tax Postcode',
  `code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Code',
  `rate` decimal(12,4) NOT NULL COMMENT 'Rate',
  `zip_is_range` smallint DEFAULT NULL COMMENT 'Zip Is Range',
  `zip_from` int unsigned DEFAULT NULL COMMENT 'Zip From',
  `zip_to` int unsigned DEFAULT NULL COMMENT 'Zip To',
  PRIMARY KEY (`tax_calculation_rate_id`),
  KEY `[[DBPREFIX]]TAX_CALC_RATE_TAX_COUNTRY_ID_TAX_REGION_ID_TAX_POSTCODE` (`tax_country_id`,`tax_region_id`,`tax_postcode`),
  KEY `[[DBPREFIX]]TAX_CALCULATION_RATE_CODE` (`code`),
  KEY `IDX_A3AD8DCACB38995910B5FDF5D42127A2` (`tax_calculation_rate_id`,`tax_country_id`,`tax_region_id`,`zip_is_range`,`tax_postcode`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT='Tax Calculation Rate';

--
-- Dumping data for table `[[dbprefix]]tax_calculation_rate`
--

INSERT INTO `[[dbprefix]]tax_calculation_rate` VALUES (1,'US',12,'*','US-CA-*-Rate 1',8.2500,NULL,NULL,NULL),(2,'US',43,'*','US-NY-*-Rate 1',8.3750,NULL,NULL,NULL);

--
-- Table structure for table `[[dbprefix]]tax_calculation_rate_title`
--

CREATE TABLE `[[dbprefix]]tax_calculation_rate_title` (
  `tax_calculation_rate_title_id` int NOT NULL AUTO_INCREMENT COMMENT 'Tax Calculation Rate Title ID',
  `tax_calculation_rate_id` int NOT NULL COMMENT 'Tax Calculation Rate ID',
  `store_id` smallint unsigned NOT NULL COMMENT 'Store ID',
  `value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Value',
  PRIMARY KEY (`tax_calculation_rate_title_id`),
  KEY `[[DBPREFIX]]TAX_CALCULATION_RATE_TITLE_TAX_CALCULATION_RATE_ID_STORE_ID` (`tax_calculation_rate_id`,`store_id`),
  KEY `[[DBPREFIX]]TAX_CALCULATION_RATE_TITLE_STORE_ID` (`store_id`),
  CONSTRAINT `FK_D28111D1128C56F7BE39EF301F9F32B2` FOREIGN KEY (`tax_calculation_rate_id`) REFERENCES `[[dbprefix]]tax_calculation_rate` (`tax_calculation_rate_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]TAX_CALCULATION_RATE_TITLE_STORE_ID_[[DBPREFIX]]STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Tax Calculation Rate Title';

--
-- Dumping data for table `[[dbprefix]]tax_calculation_rate_title`
--


--
-- Table structure for table `[[dbprefix]]tax_calculation_rule`
--

CREATE TABLE `[[dbprefix]]tax_calculation_rule` (
  `tax_calculation_rule_id` int NOT NULL AUTO_INCREMENT COMMENT 'Tax Calculation Rule ID',
  `code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Code',
  `priority` int NOT NULL COMMENT 'Priority',
  `position` int NOT NULL COMMENT 'Position',
  `calculate_subtotal` int NOT NULL COMMENT 'Calculate off subtotal option',
  PRIMARY KEY (`tax_calculation_rule_id`),
  KEY `[[DBPREFIX]]TAX_CALCULATION_RULE_PRIORITY_POSITION` (`priority`,`position`),
  KEY `[[DBPREFIX]]TAX_CALCULATION_RULE_CODE` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Tax Calculation Rule';

--
-- Dumping data for table `[[dbprefix]]tax_calculation_rule`
--


--
-- Table structure for table `[[dbprefix]]tax_class`
--

CREATE TABLE `[[dbprefix]]tax_class` (
  `class_id` smallint NOT NULL AUTO_INCREMENT COMMENT 'Class ID',
  `class_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Class Name',
  `class_type` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'CUSTOMER' COMMENT 'Class Type',
  PRIMARY KEY (`class_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COMMENT='Tax Class';

--
-- Dumping data for table `[[dbprefix]]tax_class`
--

INSERT INTO `[[dbprefix]]tax_class` VALUES (2,'Taxable Goods','PRODUCT'),(3,'Retail Customer','CUSTOMER');

--
-- Table structure for table `[[dbprefix]]tax_order_aggregated_created`
--

CREATE TABLE `[[dbprefix]]tax_order_aggregated_created` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `period` date DEFAULT NULL COMMENT 'Period',
  `store_id` smallint unsigned DEFAULT NULL COMMENT 'Store ID',
  `code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Code',
  `order_status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Order Status',
  `percent` float DEFAULT NULL COMMENT 'Percent',
  `orders_count` int unsigned NOT NULL DEFAULT '0' COMMENT 'Orders Count',
  `tax_base_amount_sum` float DEFAULT NULL COMMENT 'Tax Base Amount Sum',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNQ_A719D9444F7B979B92D2369CE724F9D0` (`period`,`store_id`,`code`,`percent`,`order_status`),
  KEY `[[DBPREFIX]]TAX_ORDER_AGGREGATED_CREATED_STORE_ID` (`store_id`),
  CONSTRAINT `[[DBPREFIX]]TAX_ORDER_AGGREGATED_CREATED_STORE_ID_[[DBPREFIX]]STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Tax Order Aggregation';

--
-- Dumping data for table `[[dbprefix]]tax_order_aggregated_created`
--


--
-- Table structure for table `[[dbprefix]]tax_order_aggregated_updated`
--

CREATE TABLE `[[dbprefix]]tax_order_aggregated_updated` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `period` date DEFAULT NULL COMMENT 'Period',
  `store_id` smallint unsigned DEFAULT NULL COMMENT 'Store ID',
  `code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Code',
  `order_status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Order Status',
  `percent` float DEFAULT NULL COMMENT 'Percent',
  `orders_count` int unsigned NOT NULL DEFAULT '0' COMMENT 'Orders Count',
  `tax_base_amount_sum` float DEFAULT NULL COMMENT 'Tax Base Amount Sum',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNQ_6C22B67A5EB5D08555BC3FA3F54DD8F3` (`period`,`store_id`,`code`,`percent`,`order_status`),
  KEY `[[DBPREFIX]]TAX_ORDER_AGGREGATED_UPDATED_STORE_ID` (`store_id`),
  CONSTRAINT `[[DBPREFIX]]TAX_ORDER_AGGREGATED_UPDATED_STORE_ID_[[DBPREFIX]]STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Tax Order Aggregated Updated';

--
-- Dumping data for table `[[dbprefix]]tax_order_aggregated_updated`
--


--
-- Table structure for table `[[dbprefix]]tfa_country_codes`
--

CREATE TABLE `[[dbprefix]]tfa_country_codes` (
  `country_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'TFA admin user ID',
  `code` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Country code',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Country name',
  `dial_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Prefix',
  PRIMARY KEY (`country_id`),
  KEY `[[DBPREFIX]]TFA_COUNTRY_CODES_CODE` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=242 DEFAULT CHARSET=utf8mb4 COMMENT='tfa_country_codes';

--
-- Dumping data for table `[[dbprefix]]tfa_country_codes`
--

INSERT INTO `[[dbprefix]]tfa_country_codes` VALUES (1,'IL','Israel','+972'),(2,'AF','Afghanistan','+93'),(3,'AL','Albania','+355'),(4,'DZ','Algeria','+213'),(5,'AS','AmericanSamoa','+1 684'),(6,'AD','Andorra','+376'),(7,'AO','Angola','+244'),(8,'AI','Anguilla','+1 264'),(9,'AG','Antigua and Barbuda','+1268'),(10,'AR','Argentina','+54'),(11,'AM','Armenia','+374'),(12,'AW','Aruba','+297'),(13,'AU','Australia','+61'),(14,'AT','Austria','+43'),(15,'AZ','Azerbaijan','+994'),(16,'BS','Bahamas','+1 242'),(17,'BH','Bahrain','+973'),(18,'BD','Bangladesh','+880'),(19,'BB','Barbados','+1 246'),(20,'BY','Belarus','+375'),(21,'BE','Belgium','+32'),(22,'BZ','Belize','+501'),(23,'BJ','Benin','+229'),(24,'BM','Bermuda','+1 441'),(25,'BT','Bhutan','+975'),(26,'BA','Bosnia and Herzegovina','+387'),(27,'BW','Botswana','+267'),(28,'BR','Brazil','+55'),(29,'IO','British Indian Ocean Territory','+246'),(30,'BG','Bulgaria','+359'),(31,'BF','Burkina Faso','+226'),(32,'BI','Burundi','+257'),(33,'KH','Cambodia','+855'),(34,'CM','Cameroon','+237'),(35,'CA','Canada','+1'),(36,'CV','Cape Verde','+238'),(37,'KY','Cayman Islands','+ 345'),(38,'CF','Central African Republic','+236'),(39,'TD','Chad','+235'),(40,'CL','Chile','+56'),(41,'CN','China','+86'),(42,'CX','Christmas Island','+61'),(43,'CO','Colombia','+57'),(44,'KM','Comoros','+269'),(45,'CG','Congo','+242'),(46,'CK','Cook Islands','+682'),(47,'CR','Costa Rica','+506'),(48,'HR','Croatia','+385'),(49,'CU','Cuba','+53'),(50,'CY','Cyprus','+537'),(51,'CZ','Czech Republic','+420'),(52,'DK','Denmark','+45'),(53,'DJ','Djibouti','+253'),(54,'DM','Dominica','+1 767'),(55,'DO','Dominican Republic','+1 849'),(56,'EC','Ecuador','+593'),(57,'EG','Egypt','+20'),(58,'SV','El Salvador','+503'),(59,'GQ','Equatorial Guinea','+240'),(60,'ER','Eritrea','+291'),(61,'EE','Estonia','+372'),(62,'ET','Ethiopia','+251'),(63,'FO','Faroe Islands','+298'),(64,'FJ','Fiji','+679'),(65,'FI','Finland','+358'),(66,'FR','France','+33'),(67,'GF','French Guiana','+594'),(68,'PF','French Polynesia','+689'),(69,'GA','Gabon','+241'),(70,'GM','Gambia','+220'),(71,'GE','Georgia','+995'),(72,'DE','Germany','+49'),(73,'GH','Ghana','+233'),(74,'GI','Gibraltar','+350'),(75,'GR','Greece','+30'),(76,'GL','Greenland','+299'),(77,'GD','Grenada','+1 473'),(78,'GP','Guadeloupe','+590'),(79,'GU','Guam','+1 671'),(80,'GT','Guatemala','+502'),(81,'GN','Guinea','+224'),(82,'GW','Guinea-Bissau','+245'),(83,'GY','Guyana','+595'),(84,'HT','Haiti','+509'),(85,'HN','Honduras','+504'),(86,'HU','Hungary','+36'),(87,'IS','Iceland','+354'),(88,'IN','India','+91'),(89,'ID','Indonesia','+62'),(90,'IQ','Iraq','+964'),(91,'IE','Ireland','+353'),(92,'IL','Israel','+972'),(93,'IT','Italy','+39'),(94,'JM','Jamaica','+1 876'),(95,'JP','Japan','+81'),(96,'JO','Jordan','+962'),(97,'KZ','Kazakhstan','+7 7'),(98,'KE','Kenya','+254'),(99,'KI','Kiribati','+686'),(100,'KW','Kuwait','+965'),(101,'KG','Kyrgyzstan','+996'),(102,'LV','Latvia','+371'),(103,'LB','Lebanon','+961'),(104,'LS','Lesotho','+266'),(105,'LR','Liberia','+231'),(106,'LI','Liechtenstein','+423'),(107,'LT','Lithuania','+370'),(108,'LU','Luxembourg','+352'),(109,'MG','Madagascar','+261'),(110,'MW','Malawi','+265'),(111,'MY','Malaysia','+60'),(112,'MV','Maldives','+960'),(113,'ML','Mali','+223'),(114,'MT','Malta','+356'),(115,'MH','Marshall Islands','+692'),(116,'MQ','Martinique','+596'),(117,'MR','Mauritania','+222'),(118,'MU','Mauritius','+230'),(119,'YT','Mayotte','+262'),(120,'MX','Mexico','+52'),(121,'MC','Monaco','+377'),(122,'MN','Mongolia','+976'),(123,'ME','Montenegro','+382'),(124,'MS','Montserrat','+1664'),(125,'MA','Morocco','+212'),(126,'MM','Myanmar','+95'),(127,'NA','Namibia','+264'),(128,'NR','Nauru','+674'),(129,'NP','Nepal','+977'),(130,'NL','Netherlands','+31'),(131,'AN','Netherlands Antilles','+599'),(132,'NC','New Caledonia','+687'),(133,'NZ','New Zealand','+64'),(134,'NI','Nicaragua','+505'),(135,'NE','Niger','+227'),(136,'NG','Nigeria','+234'),(137,'NU','Niue','+683'),(138,'NF','Norfolk Island','+672'),(139,'MP','Northern Mariana Islands','+1 670'),(140,'NO','Norway','+47'),(141,'OM','Oman','+968'),(142,'PK','Pakistan','+92'),(143,'PW','Palau','+680'),(144,'PA','Panama','+507'),(145,'PG','Papua New Guinea','+675'),(146,'PY','Paraguay','+595'),(147,'PE','Peru','+51'),(148,'PH','Philippines','+63'),(149,'PL','Poland','+48'),(150,'PT','Portugal','+351'),(151,'PR','Puerto Rico','+1 939'),(152,'QA','Qatar','+974'),(153,'RO','Romania','+40'),(154,'RW','Rwanda','+250'),(155,'WS','Samoa','+685'),(156,'SM','San Marino','+378'),(157,'SA','Saudi Arabia','+966'),(158,'SN','Senegal','+221'),(159,'RS','Serbia','+381'),(160,'SC','Seychelles','+248'),(161,'SL','Sierra Leone','+232'),(162,'SG','Singapore','+65'),(163,'SK','Slovakia','+421'),(164,'SI','Slovenia','+386'),(165,'SB','Solomon Islands','+677'),(166,'ZA','South Africa','+27'),(167,'GS','South Georgia and the South Sandwich Islands','+500'),(168,'ES','Spain','+34'),(169,'LK','Sri Lanka','+94'),(170,'SD','Sudan','+249'),(171,'SR','Suriname','+597'),(172,'SZ','Swaziland','+268'),(173,'SE','Sweden','+46'),(174,'CH','Switzerland','+41'),(175,'TJ','Tajikistan','+992'),(176,'TH','Thailand','+66'),(177,'TG','Togo','+228'),(178,'TK','Tokelau','+690'),(179,'TO','Tonga','+676'),(180,'TT','Trinidad and Tobago','+1 868'),(181,'TN','Tunisia','+216'),(182,'TR','Turkey','+90'),(183,'TM','Turkmenistan','+993'),(184,'TC','Turks and Caicos Islands','+1 649'),(185,'TV','Tuvalu','+688'),(186,'UG','Uganda','+256'),(187,'UA','Ukraine','+380'),(188,'AE','United Arab Emirates','+971'),(189,'GB','United Kingdom','+44'),(190,'US','United States','+1'),(191,'UY','Uruguay','+598'),(192,'UZ','Uzbekistan','+998'),(193,'VU','Vanuatu','+678'),(194,'WF','Wallis and Futuna','+681'),(195,'YE','Yemen','+967'),(196,'ZM','Zambia','+260'),(197,'ZW','Zimbabwe','+263'),(198,'AX','land Islands',''),(199,'BO','Bolivia, Plurinational State of','+591'),(200,'BN','Brunei Darussalam','+673'),(201,'CC','Cocos (Keeling) Islands','+61'),(202,'CD','Congo, The Democratic Republic of the','+243'),(203,'CI','Cote d\'Ivoire','+225'),(204,'FK','Falkland Islands (Malvinas)','+500'),(205,'GG','Guernsey','+44'),(206,'VA','Holy See (Vatican City State)','+379'),(207,'HK','Hong Kong','+852'),(208,'IR','Iran, Islamic Republic of','+98'),(209,'IM','Isle of Man','+44'),(210,'JE','Jersey','+44'),(211,'KP','Korea, Democratic People\'s Republic of','+850'),(212,'KR','Korea, Republic of','+82'),(213,'LA','Lao People\'s Democratic Republic','+856'),(214,'LY','Libyan Arab Jamahiriya','+218'),(215,'MO','Macao','+853'),(216,'MK','Macedonia, The Former Yugoslav Republic of','+389'),(217,'FM','Micronesia, Federated States of','+691'),(218,'MD','Moldova, Republic of','+373'),(219,'MZ','Mozambique','+258'),(220,'PS','Palestinian Territory, Occupied','+970'),(221,'PN','Pitcairn','+872'),(222,'RE','Réunion','+262'),(223,'RU','Russia','+7'),(224,'BL','Saint Barthélemy','+590'),(225,'SH','Saint Helena, Ascension and Tristan Da Cunha','+290'),(226,'KN','Saint Kitts and Nevis','+1 869'),(227,'LC','Saint Lucia','+1 758'),(228,'MF','Saint Martin','+590'),(229,'PM','Saint Pierre and Miquelon','+508'),(230,'VC','Saint Vincent and the Grenadines','+1 784'),(231,'ST','Sao Tome and Principe','+239'),(232,'SO','Somalia','+252'),(233,'SJ','Svalbard and Jan Mayen','+47'),(234,'SY','Syrian Arab Republic','+963'),(235,'TW','Taiwan, Province of China','+886'),(236,'TZ','Tanzania, United Republic of','+255'),(237,'TL','Timor-Leste','+670'),(238,'VE','Venezuela, Bolivarian Republic of','+58'),(239,'VN','Viet Nam','+84'),(240,'VG','Virgin Islands, British','+1 284'),(241,'VI','Virgin Islands, U.S.','+1 340');

--
-- Table structure for table `[[dbprefix]]tfa_user_config`
--

CREATE TABLE `[[dbprefix]]tfa_user_config` (
  `config_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'TFA admin user ID',
  `user_id` int unsigned NOT NULL COMMENT 'User ID',
  `encoded_providers` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Encoded providers list',
  `encoded_config` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Encoded providers configuration',
  `default_provider` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Default provider',
  PRIMARY KEY (`config_id`),
  KEY `[[DBPREFIX]]TFA_USER_CONFIG_USER_ID_[[DBPREFIX]]ADMIN_USER_USER_ID` (`user_id`),
  CONSTRAINT `[[DBPREFIX]]TFA_USER_CONFIG_USER_ID_[[DBPREFIX]]ADMIN_USER_USER_ID` FOREIGN KEY (`user_id`) REFERENCES `[[dbprefix]]admin_user` (`user_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='tfa_user_config';

--
-- Dumping data for table `[[dbprefix]]tfa_user_config`
--


--
-- Table structure for table `[[dbprefix]]theme`
--

CREATE TABLE `[[dbprefix]]theme` (
  `theme_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Theme identifier',
  `parent_id` int DEFAULT NULL COMMENT 'Parent ID',
  `theme_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Theme Path',
  `theme_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Theme Title',
  `preview_image` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Preview Image',
  `is_featured` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Is Theme Featured',
  `area` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Theme Area',
  `type` smallint NOT NULL COMMENT 'Theme type: 0:physical, 1:virtual, 2:staging',
  `code` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Full theme code, including package',
  PRIMARY KEY (`theme_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COMMENT='Core theme';

--
-- Dumping data for table `[[dbprefix]]theme`
--

INSERT INTO `[[dbprefix]]theme` VALUES (1,NULL,'Magento/blank','Magento Blank','preview_image_67f74eaab1b52.jpeg',0,'frontend',0,'Magento/blank'),(2,NULL,'Magento/backend','Magento 2 backend',NULL,0,'adminhtml',0,'Magento/backend'),(3,1,'Magento/luma','Magento Luma','preview_image_67f74eaac469b.jpeg',0,'frontend',0,'Magento/luma');

--
-- Table structure for table `[[dbprefix]]theme_file`
--

CREATE TABLE `[[dbprefix]]theme_file` (
  `theme_files_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Theme files identifier',
  `theme_id` int unsigned NOT NULL COMMENT 'Theme ID',
  `file_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Relative path to file',
  `file_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'File Type',
  `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'File Content',
  `sort_order` smallint NOT NULL DEFAULT '0' COMMENT 'Sort Order',
  `is_temporary` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Is Temporary File',
  PRIMARY KEY (`theme_files_id`),
  KEY `[[DBPREFIX]]THEME_FILE_THEME_ID_[[DBPREFIX]]THEME_THEME_ID` (`theme_id`),
  CONSTRAINT `[[DBPREFIX]]THEME_FILE_THEME_ID_[[DBPREFIX]]THEME_THEME_ID` FOREIGN KEY (`theme_id`) REFERENCES `[[dbprefix]]theme` (`theme_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Core theme files';

--
-- Dumping data for table `[[dbprefix]]theme_file`
--


--
-- Table structure for table `[[dbprefix]]translation`
--

CREATE TABLE `[[dbprefix]]translation` (
  `key_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Key ID of Translation',
  `string` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'Translate String' COMMENT 'Translation String',
  `store_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Store ID',
  `translate` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Translate',
  `locale` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'en_US' COMMENT 'Locale',
  `crc_string` bigint NOT NULL DEFAULT '1591228201' COMMENT 'Translation String CRC32 Hash',
  PRIMARY KEY (`key_id`),
  UNIQUE KEY `[[DBPREFIX]]TRANSLATION_STORE_ID_LOCALE_CRC_STRING_STRING` (`store_id`,`locale`,`crc_string`,`string`),
  CONSTRAINT `[[DBPREFIX]]TRANSLATION_STORE_ID_[[DBPREFIX]]STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Translations';

--
-- Dumping data for table `[[dbprefix]]translation`
--


--
-- Table structure for table `[[dbprefix]]ui_bookmark`
--

CREATE TABLE `[[dbprefix]]ui_bookmark` (
  `bookmark_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Bookmark identifier',
  `user_id` int unsigned NOT NULL COMMENT 'User ID',
  `namespace` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Bookmark namespace',
  `identifier` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Bookmark Identifier',
  `current` smallint NOT NULL COMMENT 'Mark current bookmark per user and identifier',
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Bookmark title',
  `config` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Bookmark config',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Bookmark created at',
  `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Bookmark updated at',
  PRIMARY KEY (`bookmark_id`),
  KEY `[[DBPREFIX]]UI_BOOKMARK_USER_ID_NAMESPACE_IDENTIFIER` (`user_id`,`namespace`,`identifier`),
  CONSTRAINT `[[DBPREFIX]]UI_BOOKMARK_USER_ID_[[DBPREFIX]]ADMIN_USER_USER_ID` FOREIGN KEY (`user_id`) REFERENCES `[[dbprefix]]admin_user` (`user_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Bookmark';

--
-- Dumping data for table `[[dbprefix]]ui_bookmark`
--


--
-- Table structure for table `[[dbprefix]]url_rewrite`
--

CREATE TABLE `[[dbprefix]]url_rewrite` (
  `url_rewrite_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Rewrite ID',
  `entity_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Entity type code',
  `entity_id` int unsigned NOT NULL COMMENT 'Entity ID',
  `request_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Request Path',
  `target_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Target Path',
  `redirect_type` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Redirect Type',
  `store_id` smallint unsigned NOT NULL COMMENT 'Store ID',
  `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Description',
  `is_autogenerated` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Is rewrite generated automatically flag',
  `metadata` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Meta data for url rewrite',
  PRIMARY KEY (`url_rewrite_id`),
  UNIQUE KEY `[[DBPREFIX]]URL_REWRITE_REQUEST_PATH_STORE_ID` (`request_path`,`store_id`),
  KEY `[[DBPREFIX]]URL_REWRITE_TARGET_PATH` (`target_path`),
  KEY `[[DBPREFIX]]URL_REWRITE_STORE_ID_ENTITY_ID` (`store_id`,`entity_id`),
  KEY `[[DBPREFIX]]URL_REWRITE_ENTITY_ID` (`entity_id`),
  KEY `[[DBPREFIX]]URL_REWRITE_IS_AUTOGENERATED_METADATA` (`is_autogenerated`,`metadata`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COMMENT='Url Rewrites';

--
-- Dumping data for table `[[dbprefix]]url_rewrite`
--

INSERT INTO `[[dbprefix]]url_rewrite` VALUES (1,'cms-page',1,'no-route','cms/page/view/page_id/1',0,1,NULL,1,NULL),(2,'cms-page',2,'home','cms/page/view/page_id/2',0,1,NULL,1,NULL),(3,'cms-page',3,'enable-cookies','cms/page/view/page_id/3',0,1,NULL,1,NULL),(4,'cms-page',4,'privacy-policy-cookie-restriction-mode','cms/page/view/page_id/4',0,1,NULL,1,NULL);

--
-- Table structure for table `[[dbprefix]]variable`
--

CREATE TABLE `[[dbprefix]]variable` (
  `variable_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Variable ID',
  `code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Variable Code',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Variable Name',
  PRIMARY KEY (`variable_id`),
  UNIQUE KEY `[[DBPREFIX]]VARIABLE_CODE` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Variables';

--
-- Dumping data for table `[[dbprefix]]variable`
--


--
-- Table structure for table `[[dbprefix]]variable_value`
--

CREATE TABLE `[[dbprefix]]variable_value` (
  `value_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Variable Value ID',
  `variable_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Variable ID',
  `store_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Store ID',
  `plain_value` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Plain Text Value',
  `html_value` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Html Value',
  PRIMARY KEY (`value_id`),
  UNIQUE KEY `[[DBPREFIX]]VARIABLE_VALUE_VARIABLE_ID_STORE_ID` (`variable_id`,`store_id`),
  KEY `[[DBPREFIX]]VARIABLE_VALUE_STORE_ID` (`store_id`),
  CONSTRAINT `[[DBPREFIX]]VARIABLE_VALUE_STORE_ID_[[DBPREFIX]]STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]VARIABLE_VALUE_VARIABLE_ID_[[DBPREFIX]]VARIABLE_VARIABLE_ID` FOREIGN KEY (`variable_id`) REFERENCES `[[dbprefix]]variable` (`variable_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Variable Value';

--
-- Dumping data for table `[[dbprefix]]variable_value`
--


--
-- Table structure for table `[[dbprefix]]vault_payment_token`
--

CREATE TABLE `[[dbprefix]]vault_payment_token` (
  `entity_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `customer_id` int unsigned DEFAULT NULL COMMENT 'Customer ID',
  `website_id` int unsigned DEFAULT NULL COMMENT 'Website ID',
  `public_hash` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Hash code for using on frontend',
  `payment_method_code` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Payment method code',
  `type` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Type',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Created At',
  `expires_at` timestamp NULL DEFAULT NULL COMMENT 'Expires At',
  `gateway_token` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Gateway Token',
  `details` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Details',
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `is_visible` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`entity_id`),
  UNIQUE KEY `[[DBPREFIX]]VAULT_PAYMENT_TOKEN_PUBLIC_HASH` (`public_hash`),
  UNIQUE KEY `UNQ_8A3A66ADA892E72943DABBC512E7BA4B` (`payment_method_code`,`customer_id`,`gateway_token`),
  KEY `[[DBPREFIX]]VAULT_PAYMENT_TOKEN_CSTR_ID_[[DBPREFIX]]CSTR_ENTT_ENTT_ID` (`customer_id`),
  CONSTRAINT `[[DBPREFIX]]VAULT_PAYMENT_TOKEN_CSTR_ID_[[DBPREFIX]]CSTR_ENTT_ENTT_ID` FOREIGN KEY (`customer_id`) REFERENCES `[[dbprefix]]customer_entity` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Vault tokens of payment';

--
-- Dumping data for table `[[dbprefix]]vault_payment_token`
--


--
-- Table structure for table `[[dbprefix]]vault_payment_token_order_payment_link`
--

CREATE TABLE `[[dbprefix]]vault_payment_token_order_payment_link` (
  `order_payment_id` int unsigned NOT NULL COMMENT 'Order payment ID',
  `payment_token_id` int unsigned NOT NULL COMMENT 'Payment token ID',
  PRIMARY KEY (`order_payment_id`,`payment_token_id`),
  KEY `FK_9DDDB313998578BE4AC6CAA0A85DD75C` (`payment_token_id`),
  CONSTRAINT `FK_9DDDB313998578BE4AC6CAA0A85DD75C` FOREIGN KEY (`payment_token_id`) REFERENCES `[[dbprefix]]vault_payment_token` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `FK_F2B3983591CCBE38509B9B3399D03DB2` FOREIGN KEY (`order_payment_id`) REFERENCES `[[dbprefix]]sales_order_payment` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Order payments to vault token';

--
-- Dumping data for table `[[dbprefix]]vault_payment_token_order_payment_link`
--


--
-- Table structure for table `[[dbprefix]]weee_tax`
--

CREATE TABLE `[[dbprefix]]weee_tax` (
  `value_id` int NOT NULL AUTO_INCREMENT COMMENT 'Value ID',
  `website_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Website ID',
  `entity_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Entity ID',
  `country` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Country',
  `value` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Value',
  `state` int NOT NULL DEFAULT '0' COMMENT 'State',
  `attribute_id` smallint unsigned NOT NULL COMMENT 'Attribute ID',
  PRIMARY KEY (`value_id`),
  KEY `[[DBPREFIX]]WEEE_TAX_WEBSITE_ID` (`website_id`),
  KEY `[[DBPREFIX]]WEEE_TAX_ENTITY_ID` (`entity_id`),
  KEY `[[DBPREFIX]]WEEE_TAX_COUNTRY` (`country`),
  KEY `[[DBPREFIX]]WEEE_TAX_ATTRIBUTE_ID` (`attribute_id`),
  CONSTRAINT `[[DBPREFIX]]WEEE_TAX_ATTRIBUTE_ID_[[DBPREFIX]]EAV_ATTRIBUTE_ATTRIBUTE_ID` FOREIGN KEY (`attribute_id`) REFERENCES `[[dbprefix]]eav_attribute` (`attribute_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]WEEE_TAX_COUNTRY_[[DBPREFIX]]DIRECTORY_COUNTRY_COUNTRY_ID` FOREIGN KEY (`country`) REFERENCES `[[dbprefix]]directory_country` (`country_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]WEEE_TAX_ENTITY_ID_[[DBPREFIX]]CATALOG_PRODUCT_ENTITY_ENTITY_ID` FOREIGN KEY (`entity_id`) REFERENCES `[[dbprefix]]catalog_product_entity` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]WEEE_TAX_WEBSITE_ID_[[DBPREFIX]]STORE_WEBSITE_WEBSITE_ID` FOREIGN KEY (`website_id`) REFERENCES `[[dbprefix]]store_website` (`website_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Weee Tax';

--
-- Dumping data for table `[[dbprefix]]weee_tax`
--


--
-- Table structure for table `[[dbprefix]]widget`
--

CREATE TABLE `[[dbprefix]]widget` (
  `widget_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Widget ID',
  `widget_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Widget code for template directive',
  `widget_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Widget Type',
  `parameters` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Parameters',
  PRIMARY KEY (`widget_id`),
  KEY `[[DBPREFIX]]WIDGET_WIDGET_CODE` (`widget_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Preconfigured Widgets';

--
-- Dumping data for table `[[dbprefix]]widget`
--


--
-- Table structure for table `[[dbprefix]]widget_instance`
--

CREATE TABLE `[[dbprefix]]widget_instance` (
  `instance_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Instance ID',
  `instance_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Instance Type',
  `theme_id` int unsigned NOT NULL COMMENT 'Theme ID',
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Widget Title',
  `store_ids` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT 'Store ids',
  `widget_parameters` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Widget parameters',
  `sort_order` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Sort order',
  PRIMARY KEY (`instance_id`),
  KEY `[[DBPREFIX]]WIDGET_INSTANCE_THEME_ID_[[DBPREFIX]]THEME_THEME_ID` (`theme_id`),
  CONSTRAINT `[[DBPREFIX]]WIDGET_INSTANCE_THEME_ID_[[DBPREFIX]]THEME_THEME_ID` FOREIGN KEY (`theme_id`) REFERENCES `[[dbprefix]]theme` (`theme_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Instances of Widget for Package Theme';

--
-- Dumping data for table `[[dbprefix]]widget_instance`
--


--
-- Table structure for table `[[dbprefix]]widget_instance_page`
--

CREATE TABLE `[[dbprefix]]widget_instance_page` (
  `page_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Page ID',
  `instance_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Instance ID',
  `page_group` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Block Group Type',
  `layout_handle` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Layout Handle',
  `block_reference` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Container',
  `page_for` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'For instance entities',
  `entities` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Catalog entities (comma separated)',
  `page_template` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Path to widget template',
  PRIMARY KEY (`page_id`),
  KEY `[[DBPREFIX]]WIDGET_INSTANCE_PAGE_INSTANCE_ID` (`instance_id`),
  CONSTRAINT `FK_8CEB8E4A49C1C3B5DA3955BA7D727D5D` FOREIGN KEY (`instance_id`) REFERENCES `[[dbprefix]]widget_instance` (`instance_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Instance of Widget on Page';

--
-- Dumping data for table `[[dbprefix]]widget_instance_page`
--


--
-- Table structure for table `[[dbprefix]]widget_instance_page_layout`
--

CREATE TABLE `[[dbprefix]]widget_instance_page_layout` (
  `page_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Page ID',
  `layout_update_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Layout Update ID',
  PRIMARY KEY (`layout_update_id`,`page_id`),
  KEY `[[DBPREFIX]]WIDGET_INSTANCE_PAGE_LAYOUT_PAGE_ID` (`page_id`),
  CONSTRAINT `FK_4A92EC86A64E5198C495C2359162AD22` FOREIGN KEY (`page_id`) REFERENCES `[[dbprefix]]widget_instance_page` (`page_id`) ON DELETE CASCADE,
  CONSTRAINT `FK_79179AAD75F12559E0DB3AD9C51FF5BD` FOREIGN KEY (`layout_update_id`) REFERENCES `[[dbprefix]]layout_update` (`layout_update_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Layout updates';

--
-- Dumping data for table `[[dbprefix]]widget_instance_page_layout`
--


--
-- Table structure for table `[[dbprefix]]wishlist`
--

CREATE TABLE `[[dbprefix]]wishlist` (
  `wishlist_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Wishlist ID',
  `customer_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Customer ID',
  `shared` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Sharing flag (0 or 1)',
  `sharing_code` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Sharing encrypted code',
  `updated_at` timestamp NULL DEFAULT NULL COMMENT 'Last updated date',
  PRIMARY KEY (`wishlist_id`),
  UNIQUE KEY `[[DBPREFIX]]WISHLIST_CUSTOMER_ID` (`customer_id`),
  KEY `[[DBPREFIX]]WISHLIST_SHARED` (`shared`),
  CONSTRAINT `[[DBPREFIX]]WISHLIST_CUSTOMER_ID_[[DBPREFIX]]CUSTOMER_ENTITY_ENTITY_ID` FOREIGN KEY (`customer_id`) REFERENCES `[[dbprefix]]customer_entity` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Wishlist main Table';

--
-- Dumping data for table `[[dbprefix]]wishlist`
--


--
-- Table structure for table `[[dbprefix]]wishlist_item`
--

CREATE TABLE `[[dbprefix]]wishlist_item` (
  `wishlist_item_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Wishlist item ID',
  `wishlist_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Wishlist ID',
  `product_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Product ID',
  `store_id` smallint unsigned DEFAULT NULL COMMENT 'Store ID',
  `added_at` timestamp NULL DEFAULT NULL COMMENT 'Add date and time',
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Short description of wish list item',
  `qty` decimal(12,4) NOT NULL COMMENT 'Qty',
  PRIMARY KEY (`wishlist_item_id`),
  KEY `[[DBPREFIX]]WISHLIST_ITEM_WISHLIST_ID` (`wishlist_id`),
  KEY `[[DBPREFIX]]WISHLIST_ITEM_PRODUCT_ID` (`product_id`),
  KEY `[[DBPREFIX]]WISHLIST_ITEM_STORE_ID` (`store_id`),
  CONSTRAINT `[[DBPREFIX]]WISHLIST_ITEM_PRD_ID_[[DBPREFIX]]CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `[[dbprefix]]catalog_product_entity` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `[[DBPREFIX]]WISHLIST_ITEM_STORE_ID_[[DBPREFIX]]STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `[[dbprefix]]store` (`store_id`) ON DELETE SET NULL,
  CONSTRAINT `[[DBPREFIX]]WISHLIST_ITEM_WISHLIST_ID_[[DBPREFIX]]WISHLIST_WISHLIST_ID` FOREIGN KEY (`wishlist_id`) REFERENCES `[[dbprefix]]wishlist` (`wishlist_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Wishlist items';

--
-- Dumping data for table `[[dbprefix]]wishlist_item`
--


--
-- Table structure for table `[[dbprefix]]wishlist_item_option`
--

CREATE TABLE `[[dbprefix]]wishlist_item_option` (
  `option_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Option ID',
  `wishlist_item_id` int unsigned NOT NULL COMMENT 'Wishlist Item ID',
  `product_id` int unsigned NOT NULL COMMENT 'Product ID',
  `code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Code',
  `value` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Value',
  PRIMARY KEY (`option_id`),
  KEY `FK_50A2E7BB0F31EC0BC615E7F5040A12AC` (`wishlist_item_id`),
  CONSTRAINT `FK_50A2E7BB0F31EC0BC615E7F5040A12AC` FOREIGN KEY (`wishlist_item_id`) REFERENCES `[[dbprefix]]wishlist_item` (`wishlist_item_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Wishlist Item Option Table';

--
-- Dumping data for table `[[dbprefix]]wishlist_item_option`
--


--
-- Dumping routines for database 'magento248'
--

--
-- Final view structure for view `[[dbprefix]]inventory_stock_1`
--

/*!50001 DROP VIEW IF EXISTS `[[dbprefix]]inventory_stock_1`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 SQL SECURITY INVOKER */
/*!50001 VIEW `[[dbprefix]]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 (`[[dbprefix]]cataloginventory_stock_status` `legacy_stock_status` join `[[dbprefix]]catalog_product_entity` `product` on((`legacy_stock_status`.`product_id` = `product`.`entity_id`))) */;



DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalog_category_entity_after_insert` AFTER INSERT ON `[[dbprefix]]catalog_category_entity` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]catalog_category_product_cl` (`entity_id`) VALUES (NEW.`entity_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalog_category_entity_after_update` AFTER UPDATE ON `[[dbprefix]]catalog_category_entity` FOR EACH ROW BEGIN
IF (NOT(NEW.`entity_id` <=> OLD.`entity_id`) OR NOT(NEW.`attribute_set_id` <=> OLD.`attribute_set_id`) OR NOT(NEW.`parent_id` <=> OLD.`parent_id`) OR NOT(NEW.`created_at` <=> OLD.`created_at`) OR NOT(NEW.`path` <=> OLD.`path`) OR NOT(NEW.`position` <=> OLD.`position`) OR NOT(NEW.`level` <=> OLD.`level`) OR NOT(NEW.`children_count` <=> OLD.`children_count`)) THEN INSERT IGNORE INTO `[[dbprefix]]catalog_category_product_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalog_category_entity_after_delete` AFTER DELETE ON `[[dbprefix]]catalog_category_entity` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]catalog_category_product_cl` (`entity_id`) VALUES (OLD.`entity_id`);
END */;;
DELIMITER ;

DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalog_category_entity_int_after_insert` AFTER INSERT ON `[[dbprefix]]catalog_category_entity_int` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]catalog_category_product_cl` (`entity_id`) VALUES (NEW.`entity_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalog_category_entity_int_after_update` AFTER UPDATE ON `[[dbprefix]]catalog_category_entity_int` FOR EACH ROW BEGIN
IF (NOT(NEW.`value_id` <=> OLD.`value_id`) OR NOT(NEW.`attribute_id` <=> OLD.`attribute_id`) OR NOT(NEW.`store_id` <=> OLD.`store_id`) OR NOT(NEW.`entity_id` <=> OLD.`entity_id`) OR NOT(NEW.`value` <=> OLD.`value`)) THEN INSERT IGNORE INTO `[[dbprefix]]catalog_category_product_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalog_category_entity_int_after_delete` AFTER DELETE ON `[[dbprefix]]catalog_category_entity_int` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]catalog_category_product_cl` (`entity_id`) VALUES (OLD.`entity_id`);
END */;;
DELIMITER ;

DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalog_category_product_after_insert` AFTER INSERT ON `[[dbprefix]]catalog_category_product` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]catalogsearch_fulltext_cl` (`entity_id`) VALUES (NEW.`product_id`);
INSERT IGNORE INTO `[[dbprefix]]catalog_product_category_cl` (`entity_id`) VALUES (NEW.`product_id`);
INSERT IGNORE INTO `[[dbprefix]]catalogrule_product_cl` (`entity_id`) VALUES (NEW.`product_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalog_category_product_after_update` AFTER UPDATE ON `[[dbprefix]]catalog_category_product` FOR EACH ROW BEGIN
IF (NOT(NEW.`entity_id` <=> OLD.`entity_id`) OR NOT(NEW.`category_id` <=> OLD.`category_id`) OR NOT(NEW.`product_id` <=> OLD.`product_id`) OR NOT(NEW.`position` <=> OLD.`position`)) THEN INSERT IGNORE INTO `[[dbprefix]]catalogsearch_fulltext_cl` (`entity_id`) VALUES (NEW.`product_id`); END IF;
IF (NOT(NEW.`entity_id` <=> OLD.`entity_id`) OR NOT(NEW.`category_id` <=> OLD.`category_id`) OR NOT(NEW.`product_id` <=> OLD.`product_id`) OR NOT(NEW.`position` <=> OLD.`position`)) THEN INSERT IGNORE INTO `[[dbprefix]]catalog_product_category_cl` (`entity_id`) VALUES (NEW.`product_id`); END IF;
IF (NOT(NEW.`entity_id` <=> OLD.`entity_id`) OR NOT(NEW.`category_id` <=> OLD.`category_id`) OR NOT(NEW.`product_id` <=> OLD.`product_id`) OR NOT(NEW.`position` <=> OLD.`position`)) THEN INSERT IGNORE INTO `[[dbprefix]]catalogrule_product_cl` (`entity_id`) VALUES (NEW.`product_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalog_category_product_after_delete` AFTER DELETE ON `[[dbprefix]]catalog_category_product` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]catalogsearch_fulltext_cl` (`entity_id`) VALUES (OLD.`product_id`);
INSERT IGNORE INTO `[[dbprefix]]catalog_product_category_cl` (`entity_id`) VALUES (OLD.`product_id`);
INSERT IGNORE INTO `[[dbprefix]]catalogrule_product_cl` (`entity_id`) VALUES (OLD.`product_id`);
END */;;
DELIMITER ;

DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalog_product_bundle_selection_after_insert` AFTER INSERT ON `[[dbprefix]]catalog_product_bundle_selection` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]catalogsearch_fulltext_cl` (`entity_id`) VALUES (NEW.`parent_product_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalog_product_bundle_selection_after_update` AFTER UPDATE ON `[[dbprefix]]catalog_product_bundle_selection` FOR EACH ROW BEGIN
IF (NOT(NEW.`selection_id` <=> OLD.`selection_id`) OR NOT(NEW.`option_id` <=> OLD.`option_id`) OR NOT(NEW.`parent_product_id` <=> OLD.`parent_product_id`) OR NOT(NEW.`product_id` <=> OLD.`product_id`) OR NOT(NEW.`position` <=> OLD.`position`) OR NOT(NEW.`is_default` <=> OLD.`is_default`) OR NOT(NEW.`selection_price_type` <=> OLD.`selection_price_type`) OR NOT(NEW.`selection_price_value` <=> OLD.`selection_price_value`) OR NOT(NEW.`selection_qty` <=> OLD.`selection_qty`) OR NOT(NEW.`selection_can_change_qty` <=> OLD.`selection_can_change_qty`)) THEN INSERT IGNORE INTO `[[dbprefix]]catalogsearch_fulltext_cl` (`entity_id`) VALUES (NEW.`parent_product_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalog_product_bundle_selection_after_delete` AFTER DELETE ON `[[dbprefix]]catalog_product_bundle_selection` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]catalogsearch_fulltext_cl` (`entity_id`) VALUES (OLD.`parent_product_id`);
END */;;
DELIMITER ;

DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalog_product_entity_after_insert` AFTER INSERT ON `[[dbprefix]]catalog_product_entity` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]catalogsearch_fulltext_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `[[dbprefix]]catalog_product_price_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `[[dbprefix]]catalogrule_product_cl` (`entity_id`) VALUES (NEW.`entity_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalog_product_entity_after_update` AFTER UPDATE ON `[[dbprefix]]catalog_product_entity` FOR EACH ROW BEGIN
IF (NOT(NEW.`entity_id` <=> OLD.`entity_id`) OR NOT(NEW.`attribute_set_id` <=> OLD.`attribute_set_id`) OR NOT(NEW.`type_id` <=> OLD.`type_id`) OR NOT(NEW.`sku` <=> OLD.`sku`) OR NOT(NEW.`has_options` <=> OLD.`has_options`) OR NOT(NEW.`required_options` <=> OLD.`required_options`) OR NOT(NEW.`created_at` <=> OLD.`created_at`)) THEN INSERT IGNORE INTO `[[dbprefix]]catalogsearch_fulltext_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
IF (NOT(NEW.`entity_id` <=> OLD.`entity_id`) OR NOT(NEW.`attribute_set_id` <=> OLD.`attribute_set_id`) OR NOT(NEW.`type_id` <=> OLD.`type_id`) OR NOT(NEW.`sku` <=> OLD.`sku`) OR NOT(NEW.`has_options` <=> OLD.`has_options`) OR NOT(NEW.`required_options` <=> OLD.`required_options`) OR NOT(NEW.`created_at` <=> OLD.`created_at`)) THEN INSERT IGNORE INTO `[[dbprefix]]catalog_product_price_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
IF (NOT(NEW.`entity_id` <=> OLD.`entity_id`) OR NOT(NEW.`attribute_set_id` <=> OLD.`attribute_set_id`) OR NOT(NEW.`type_id` <=> OLD.`type_id`) OR NOT(NEW.`sku` <=> OLD.`sku`) OR NOT(NEW.`has_options` <=> OLD.`has_options`) OR NOT(NEW.`required_options` <=> OLD.`required_options`) OR NOT(NEW.`created_at` <=> OLD.`created_at`)) THEN INSERT IGNORE INTO `[[dbprefix]]catalogrule_product_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalog_product_entity_after_delete` AFTER DELETE ON `[[dbprefix]]catalog_product_entity` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]catalogsearch_fulltext_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `[[dbprefix]]catalog_product_price_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `[[dbprefix]]catalogrule_product_cl` (`entity_id`) VALUES (OLD.`entity_id`);
END */;;
DELIMITER ;

DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalog_product_entity_datetime_after_insert` AFTER INSERT ON `[[dbprefix]]catalog_product_entity_datetime` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]catalogsearch_fulltext_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `[[dbprefix]]catalog_product_price_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `[[dbprefix]]catalogrule_product_cl` (`entity_id`) VALUES (NEW.`entity_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalog_product_entity_datetime_after_update` AFTER UPDATE ON `[[dbprefix]]catalog_product_entity_datetime` FOR EACH ROW BEGIN
IF (NOT(NEW.`value_id` <=> OLD.`value_id`) OR NOT(NEW.`attribute_id` <=> OLD.`attribute_id`) OR NOT(NEW.`store_id` <=> OLD.`store_id`) OR NOT(NEW.`entity_id` <=> OLD.`entity_id`) OR NOT(NEW.`value` <=> OLD.`value`)) THEN INSERT IGNORE INTO `[[dbprefix]]catalogsearch_fulltext_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
IF (NOT(NEW.`value_id` <=> OLD.`value_id`) OR NOT(NEW.`attribute_id` <=> OLD.`attribute_id`) OR NOT(NEW.`store_id` <=> OLD.`store_id`) OR NOT(NEW.`entity_id` <=> OLD.`entity_id`) OR NOT(NEW.`value` <=> OLD.`value`)) THEN INSERT IGNORE INTO `[[dbprefix]]catalog_product_price_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
IF (NOT(NEW.`value_id` <=> OLD.`value_id`) OR NOT(NEW.`attribute_id` <=> OLD.`attribute_id`) OR NOT(NEW.`store_id` <=> OLD.`store_id`) OR NOT(NEW.`entity_id` <=> OLD.`entity_id`) OR NOT(NEW.`value` <=> OLD.`value`)) THEN INSERT IGNORE INTO `[[dbprefix]]catalogrule_product_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalog_product_entity_datetime_after_delete` AFTER DELETE ON `[[dbprefix]]catalog_product_entity_datetime` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]catalogsearch_fulltext_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `[[dbprefix]]catalog_product_price_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `[[dbprefix]]catalogrule_product_cl` (`entity_id`) VALUES (OLD.`entity_id`);
END */;;
DELIMITER ;

DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalog_product_entity_decimal_after_insert` AFTER INSERT ON `[[dbprefix]]catalog_product_entity_decimal` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]catalogsearch_fulltext_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `[[dbprefix]]catalog_product_attribute_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `[[dbprefix]]catalog_product_price_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `[[dbprefix]]catalogrule_product_cl` (`entity_id`) VALUES (NEW.`entity_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalog_product_entity_decimal_after_update` AFTER UPDATE ON `[[dbprefix]]catalog_product_entity_decimal` FOR EACH ROW BEGIN
IF (NOT(NEW.`value_id` <=> OLD.`value_id`) OR NOT(NEW.`attribute_id` <=> OLD.`attribute_id`) OR NOT(NEW.`store_id` <=> OLD.`store_id`) OR NOT(NEW.`entity_id` <=> OLD.`entity_id`) OR NOT(NEW.`value` <=> OLD.`value`)) THEN INSERT IGNORE INTO `[[dbprefix]]catalogsearch_fulltext_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
IF (NOT(NEW.`value_id` <=> OLD.`value_id`) OR NOT(NEW.`attribute_id` <=> OLD.`attribute_id`) OR NOT(NEW.`store_id` <=> OLD.`store_id`) OR NOT(NEW.`entity_id` <=> OLD.`entity_id`) OR NOT(NEW.`value` <=> OLD.`value`)) THEN INSERT IGNORE INTO `[[dbprefix]]catalog_product_attribute_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
IF (NOT(NEW.`value_id` <=> OLD.`value_id`) OR NOT(NEW.`attribute_id` <=> OLD.`attribute_id`) OR NOT(NEW.`store_id` <=> OLD.`store_id`) OR NOT(NEW.`entity_id` <=> OLD.`entity_id`) OR NOT(NEW.`value` <=> OLD.`value`)) THEN INSERT IGNORE INTO `[[dbprefix]]catalog_product_price_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
IF (NOT(NEW.`value_id` <=> OLD.`value_id`) OR NOT(NEW.`attribute_id` <=> OLD.`attribute_id`) OR NOT(NEW.`store_id` <=> OLD.`store_id`) OR NOT(NEW.`entity_id` <=> OLD.`entity_id`) OR NOT(NEW.`value` <=> OLD.`value`)) THEN INSERT IGNORE INTO `[[dbprefix]]catalogrule_product_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalog_product_entity_decimal_after_delete` AFTER DELETE ON `[[dbprefix]]catalog_product_entity_decimal` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]catalogsearch_fulltext_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `[[dbprefix]]catalog_product_attribute_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `[[dbprefix]]catalog_product_price_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `[[dbprefix]]catalogrule_product_cl` (`entity_id`) VALUES (OLD.`entity_id`);
END */;;
DELIMITER ;

DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalog_product_entity_int_after_insert` AFTER INSERT ON `[[dbprefix]]catalog_product_entity_int` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]catalogsearch_fulltext_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `[[dbprefix]]cataloginventory_stock_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `[[dbprefix]]catalog_product_category_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `[[dbprefix]]catalog_product_attribute_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `[[dbprefix]]catalog_product_price_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `[[dbprefix]]catalogrule_product_cl` (`entity_id`) VALUES (NEW.`entity_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalog_product_entity_int_after_update` AFTER UPDATE ON `[[dbprefix]]catalog_product_entity_int` FOR EACH ROW BEGIN
IF (NOT(NEW.`value_id` <=> OLD.`value_id`) OR NOT(NEW.`attribute_id` <=> OLD.`attribute_id`) OR NOT(NEW.`store_id` <=> OLD.`store_id`) OR NOT(NEW.`entity_id` <=> OLD.`entity_id`) OR NOT(NEW.`value` <=> OLD.`value`)) THEN INSERT IGNORE INTO `[[dbprefix]]catalogsearch_fulltext_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
IF (NOT(NEW.`value_id` <=> OLD.`value_id`) OR NOT(NEW.`attribute_id` <=> OLD.`attribute_id`) OR NOT(NEW.`store_id` <=> OLD.`store_id`) OR NOT(NEW.`entity_id` <=> OLD.`entity_id`) OR NOT(NEW.`value` <=> OLD.`value`)) THEN INSERT IGNORE INTO `[[dbprefix]]cataloginventory_stock_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
IF (NOT(NEW.`value_id` <=> OLD.`value_id`) OR NOT(NEW.`attribute_id` <=> OLD.`attribute_id`) OR NOT(NEW.`store_id` <=> OLD.`store_id`) OR NOT(NEW.`entity_id` <=> OLD.`entity_id`) OR NOT(NEW.`value` <=> OLD.`value`)) THEN INSERT IGNORE INTO `[[dbprefix]]catalog_product_category_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
IF (NOT(NEW.`value_id` <=> OLD.`value_id`) OR NOT(NEW.`attribute_id` <=> OLD.`attribute_id`) OR NOT(NEW.`store_id` <=> OLD.`store_id`) OR NOT(NEW.`entity_id` <=> OLD.`entity_id`) OR NOT(NEW.`value` <=> OLD.`value`)) THEN INSERT IGNORE INTO `[[dbprefix]]catalog_product_attribute_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
IF (NOT(NEW.`value_id` <=> OLD.`value_id`) OR NOT(NEW.`attribute_id` <=> OLD.`attribute_id`) OR NOT(NEW.`store_id` <=> OLD.`store_id`) OR NOT(NEW.`entity_id` <=> OLD.`entity_id`) OR NOT(NEW.`value` <=> OLD.`value`)) THEN INSERT IGNORE INTO `[[dbprefix]]catalog_product_price_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
IF (NOT(NEW.`value_id` <=> OLD.`value_id`) OR NOT(NEW.`attribute_id` <=> OLD.`attribute_id`) OR NOT(NEW.`store_id` <=> OLD.`store_id`) OR NOT(NEW.`entity_id` <=> OLD.`entity_id`) OR NOT(NEW.`value` <=> OLD.`value`)) THEN INSERT IGNORE INTO `[[dbprefix]]catalogrule_product_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalog_product_entity_int_after_delete` AFTER DELETE ON `[[dbprefix]]catalog_product_entity_int` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]catalogsearch_fulltext_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `[[dbprefix]]cataloginventory_stock_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `[[dbprefix]]catalog_product_category_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `[[dbprefix]]catalog_product_attribute_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `[[dbprefix]]catalog_product_price_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `[[dbprefix]]catalogrule_product_cl` (`entity_id`) VALUES (OLD.`entity_id`);
END */;;
DELIMITER ;

DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalog_product_entity_text_after_insert` AFTER INSERT ON `[[dbprefix]]catalog_product_entity_text` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]catalogsearch_fulltext_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `[[dbprefix]]catalogrule_product_cl` (`entity_id`) VALUES (NEW.`entity_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalog_product_entity_text_after_update` AFTER UPDATE ON `[[dbprefix]]catalog_product_entity_text` FOR EACH ROW BEGIN
IF (NOT(NEW.`value_id` <=> OLD.`value_id`) OR NOT(NEW.`attribute_id` <=> OLD.`attribute_id`) OR NOT(NEW.`store_id` <=> OLD.`store_id`) OR NOT(NEW.`entity_id` <=> OLD.`entity_id`) OR NOT(NEW.`value` <=> OLD.`value`)) THEN INSERT IGNORE INTO `[[dbprefix]]catalogsearch_fulltext_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
IF (NOT(NEW.`value_id` <=> OLD.`value_id`) OR NOT(NEW.`attribute_id` <=> OLD.`attribute_id`) OR NOT(NEW.`store_id` <=> OLD.`store_id`) OR NOT(NEW.`entity_id` <=> OLD.`entity_id`) OR NOT(NEW.`value` <=> OLD.`value`)) THEN INSERT IGNORE INTO `[[dbprefix]]catalogrule_product_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalog_product_entity_text_after_delete` AFTER DELETE ON `[[dbprefix]]catalog_product_entity_text` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]catalogsearch_fulltext_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `[[dbprefix]]catalogrule_product_cl` (`entity_id`) VALUES (OLD.`entity_id`);
END */;;
DELIMITER ;

DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalog_product_entity_tier_price_after_insert` AFTER INSERT ON `[[dbprefix]]catalog_product_entity_tier_price` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]catalogrule_product_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `[[dbprefix]]catalog_product_price_cl` (`entity_id`) VALUES (NEW.`entity_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalog_product_entity_tier_price_after_update` AFTER UPDATE ON `[[dbprefix]]catalog_product_entity_tier_price` FOR EACH ROW BEGIN
IF (NOT(NEW.`value_id` <=> OLD.`value_id`) OR NOT(NEW.`entity_id` <=> OLD.`entity_id`) OR NOT(NEW.`all_groups` <=> OLD.`all_groups`) OR NOT(NEW.`customer_group_id` <=> OLD.`customer_group_id`) OR NOT(NEW.`qty` <=> OLD.`qty`) OR NOT(NEW.`value` <=> OLD.`value`) OR NOT(NEW.`website_id` <=> OLD.`website_id`) OR NOT(NEW.`percentage_value` <=> OLD.`percentage_value`)) THEN INSERT IGNORE INTO `[[dbprefix]]catalogrule_product_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
IF (NOT(NEW.`value_id` <=> OLD.`value_id`) OR NOT(NEW.`entity_id` <=> OLD.`entity_id`) OR NOT(NEW.`all_groups` <=> OLD.`all_groups`) OR NOT(NEW.`customer_group_id` <=> OLD.`customer_group_id`) OR NOT(NEW.`qty` <=> OLD.`qty`) OR NOT(NEW.`value` <=> OLD.`value`) OR NOT(NEW.`website_id` <=> OLD.`website_id`) OR NOT(NEW.`percentage_value` <=> OLD.`percentage_value`)) THEN INSERT IGNORE INTO `[[dbprefix]]catalog_product_price_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalog_product_entity_tier_price_after_delete` AFTER DELETE ON `[[dbprefix]]catalog_product_entity_tier_price` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]catalogrule_product_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `[[dbprefix]]catalog_product_price_cl` (`entity_id`) VALUES (OLD.`entity_id`);
END */;;
DELIMITER ;

DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalog_product_entity_varchar_after_insert` AFTER INSERT ON `[[dbprefix]]catalog_product_entity_varchar` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]catalogsearch_fulltext_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `[[dbprefix]]catalog_product_attribute_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `[[dbprefix]]catalogrule_product_cl` (`entity_id`) VALUES (NEW.`entity_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalog_product_entity_varchar_after_update` AFTER UPDATE ON `[[dbprefix]]catalog_product_entity_varchar` FOR EACH ROW BEGIN
IF (NOT(NEW.`value_id` <=> OLD.`value_id`) OR NOT(NEW.`attribute_id` <=> OLD.`attribute_id`) OR NOT(NEW.`store_id` <=> OLD.`store_id`) OR NOT(NEW.`entity_id` <=> OLD.`entity_id`) OR NOT(NEW.`value` <=> OLD.`value`)) THEN INSERT IGNORE INTO `[[dbprefix]]catalogsearch_fulltext_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
IF (NOT(NEW.`value_id` <=> OLD.`value_id`) OR NOT(NEW.`attribute_id` <=> OLD.`attribute_id`) OR NOT(NEW.`store_id` <=> OLD.`store_id`) OR NOT(NEW.`entity_id` <=> OLD.`entity_id`) OR NOT(NEW.`value` <=> OLD.`value`)) THEN INSERT IGNORE INTO `[[dbprefix]]catalog_product_attribute_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
IF (NOT(NEW.`value_id` <=> OLD.`value_id`) OR NOT(NEW.`attribute_id` <=> OLD.`attribute_id`) OR NOT(NEW.`store_id` <=> OLD.`store_id`) OR NOT(NEW.`entity_id` <=> OLD.`entity_id`) OR NOT(NEW.`value` <=> OLD.`value`)) THEN INSERT IGNORE INTO `[[dbprefix]]catalogrule_product_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalog_product_entity_varchar_after_delete` AFTER DELETE ON `[[dbprefix]]catalog_product_entity_varchar` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]catalogsearch_fulltext_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `[[dbprefix]]catalog_product_attribute_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `[[dbprefix]]catalogrule_product_cl` (`entity_id`) VALUES (OLD.`entity_id`);
END */;;
DELIMITER ;

DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalog_product_link_after_insert` AFTER INSERT ON `[[dbprefix]]catalog_product_link` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]catalogsearch_fulltext_cl` (`entity_id`) VALUES (NEW.`product_id`);
INSERT IGNORE INTO `[[dbprefix]]cataloginventory_stock_cl` (`entity_id`) VALUES (NEW.`product_id`);
INSERT IGNORE INTO `[[dbprefix]]catalog_product_attribute_cl` (`entity_id`) VALUES (NEW.`product_id`);
INSERT IGNORE INTO `[[dbprefix]]catalog_product_price_cl` (`entity_id`) VALUES (NEW.`product_id`);
INSERT IGNORE INTO `[[dbprefix]]catalogrule_product_cl` (`entity_id`) VALUES (NEW.`product_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalog_product_link_after_update` AFTER UPDATE ON `[[dbprefix]]catalog_product_link` FOR EACH ROW BEGIN
IF (NOT(NEW.`link_id` <=> OLD.`link_id`) OR NOT(NEW.`product_id` <=> OLD.`product_id`) OR NOT(NEW.`linked_product_id` <=> OLD.`linked_product_id`) OR NOT(NEW.`link_type_id` <=> OLD.`link_type_id`)) THEN INSERT IGNORE INTO `[[dbprefix]]catalogsearch_fulltext_cl` (`entity_id`) VALUES (NEW.`product_id`); END IF;
IF (NOT(NEW.`link_id` <=> OLD.`link_id`) OR NOT(NEW.`product_id` <=> OLD.`product_id`) OR NOT(NEW.`linked_product_id` <=> OLD.`linked_product_id`) OR NOT(NEW.`link_type_id` <=> OLD.`link_type_id`)) THEN INSERT IGNORE INTO `[[dbprefix]]cataloginventory_stock_cl` (`entity_id`) VALUES (NEW.`product_id`); END IF;
IF (NOT(NEW.`link_id` <=> OLD.`link_id`) OR NOT(NEW.`product_id` <=> OLD.`product_id`) OR NOT(NEW.`linked_product_id` <=> OLD.`linked_product_id`) OR NOT(NEW.`link_type_id` <=> OLD.`link_type_id`)) THEN INSERT IGNORE INTO `[[dbprefix]]catalog_product_attribute_cl` (`entity_id`) VALUES (NEW.`product_id`); END IF;
IF (NOT(NEW.`link_id` <=> OLD.`link_id`) OR NOT(NEW.`product_id` <=> OLD.`product_id`) OR NOT(NEW.`linked_product_id` <=> OLD.`linked_product_id`) OR NOT(NEW.`link_type_id` <=> OLD.`link_type_id`)) THEN INSERT IGNORE INTO `[[dbprefix]]catalog_product_price_cl` (`entity_id`) VALUES (NEW.`product_id`); END IF;
IF (NOT(NEW.`link_id` <=> OLD.`link_id`) OR NOT(NEW.`product_id` <=> OLD.`product_id`) OR NOT(NEW.`linked_product_id` <=> OLD.`linked_product_id`) OR NOT(NEW.`link_type_id` <=> OLD.`link_type_id`)) THEN INSERT IGNORE INTO `[[dbprefix]]catalogrule_product_cl` (`entity_id`) VALUES (NEW.`product_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalog_product_link_after_delete` AFTER DELETE ON `[[dbprefix]]catalog_product_link` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]catalogsearch_fulltext_cl` (`entity_id`) VALUES (OLD.`product_id`);
INSERT IGNORE INTO `[[dbprefix]]cataloginventory_stock_cl` (`entity_id`) VALUES (OLD.`product_id`);
INSERT IGNORE INTO `[[dbprefix]]catalog_product_attribute_cl` (`entity_id`) VALUES (OLD.`product_id`);
INSERT IGNORE INTO `[[dbprefix]]catalog_product_price_cl` (`entity_id`) VALUES (OLD.`product_id`);
INSERT IGNORE INTO `[[dbprefix]]catalogrule_product_cl` (`entity_id`) VALUES (OLD.`product_id`);
END */;;
DELIMITER ;

DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalog_product_super_link_after_insert` AFTER INSERT ON `[[dbprefix]]catalog_product_super_link` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]catalogsearch_fulltext_cl` (`entity_id`) VALUES (NEW.`product_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalog_product_super_link_after_update` AFTER UPDATE ON `[[dbprefix]]catalog_product_super_link` FOR EACH ROW BEGIN
IF (NOT(NEW.`link_id` <=> OLD.`link_id`) OR NOT(NEW.`product_id` <=> OLD.`product_id`) OR NOT(NEW.`parent_id` <=> OLD.`parent_id`)) THEN INSERT IGNORE INTO `[[dbprefix]]catalogsearch_fulltext_cl` (`entity_id`) VALUES (NEW.`product_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalog_product_super_link_after_delete` AFTER DELETE ON `[[dbprefix]]catalog_product_super_link` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]catalogsearch_fulltext_cl` (`entity_id`) VALUES (OLD.`product_id`);
END */;;
DELIMITER ;

DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalog_product_website_after_insert` AFTER INSERT ON `[[dbprefix]]catalog_product_website` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]catalogsearch_fulltext_cl` (`entity_id`) VALUES (NEW.`product_id`);
INSERT IGNORE INTO `[[dbprefix]]catalog_product_category_cl` (`entity_id`) VALUES (NEW.`product_id`);
INSERT IGNORE INTO `[[dbprefix]]catalog_product_price_cl` (`entity_id`) VALUES (NEW.`product_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalog_product_website_after_update` AFTER UPDATE ON `[[dbprefix]]catalog_product_website` FOR EACH ROW BEGIN
IF (NOT(NEW.`product_id` <=> OLD.`product_id`) OR NOT(NEW.`website_id` <=> OLD.`website_id`)) THEN INSERT IGNORE INTO `[[dbprefix]]catalogsearch_fulltext_cl` (`entity_id`) VALUES (NEW.`product_id`); END IF;
IF (NOT(NEW.`product_id` <=> OLD.`product_id`) OR NOT(NEW.`website_id` <=> OLD.`website_id`)) THEN INSERT IGNORE INTO `[[dbprefix]]catalog_product_category_cl` (`entity_id`) VALUES (NEW.`product_id`); END IF;
IF (NOT(NEW.`product_id` <=> OLD.`product_id`) OR NOT(NEW.`website_id` <=> OLD.`website_id`)) THEN INSERT IGNORE INTO `[[dbprefix]]catalog_product_price_cl` (`entity_id`) VALUES (NEW.`product_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalog_product_website_after_delete` AFTER DELETE ON `[[dbprefix]]catalog_product_website` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]catalogsearch_fulltext_cl` (`entity_id`) VALUES (OLD.`product_id`);
INSERT IGNORE INTO `[[dbprefix]]catalog_product_category_cl` (`entity_id`) VALUES (OLD.`product_id`);
INSERT IGNORE INTO `[[dbprefix]]catalog_product_price_cl` (`entity_id`) VALUES (OLD.`product_id`);
END */;;
DELIMITER ;

DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]cataloginventory_stock_item_after_insert` AFTER INSERT ON `[[dbprefix]]cataloginventory_stock_item` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]cataloginventory_stock_cl` (`entity_id`) VALUES (NEW.`product_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]cataloginventory_stock_item_after_update` AFTER UPDATE ON `[[dbprefix]]cataloginventory_stock_item` FOR EACH ROW BEGIN
IF (NOT(NEW.`item_id` <=> OLD.`item_id`) OR NOT(NEW.`product_id` <=> OLD.`product_id`) OR NOT(NEW.`stock_id` <=> OLD.`stock_id`) OR NOT(NEW.`qty` <=> OLD.`qty`) OR NOT(NEW.`min_qty` <=> OLD.`min_qty`) OR NOT(NEW.`use_config_min_qty` <=> OLD.`use_config_min_qty`) OR NOT(NEW.`is_qty_decimal` <=> OLD.`is_qty_decimal`) OR NOT(NEW.`backorders` <=> OLD.`backorders`) OR NOT(NEW.`use_config_backorders` <=> OLD.`use_config_backorders`) OR NOT(NEW.`min_sale_qty` <=> OLD.`min_sale_qty`) OR NOT(NEW.`use_config_min_sale_qty` <=> OLD.`use_config_min_sale_qty`) OR NOT(NEW.`max_sale_qty` <=> OLD.`max_sale_qty`) OR NOT(NEW.`use_config_max_sale_qty` <=> OLD.`use_config_max_sale_qty`) OR NOT(NEW.`is_in_stock` <=> OLD.`is_in_stock`) OR NOT(NEW.`low_stock_date` <=> OLD.`low_stock_date`) OR NOT(NEW.`notify_stock_qty` <=> OLD.`notify_stock_qty`) OR NOT(NEW.`use_config_notify_stock_qty` <=> OLD.`use_config_notify_stock_qty`) OR NOT(NEW.`manage_stock` <=> OLD.`manage_stock`) OR NOT(NEW.`use_config_manage_stock` <=> OLD.`use_config_manage_stock`) OR NOT(NEW.`stock_status_changed_auto` <=> OLD.`stock_status_changed_auto`) OR NOT(NEW.`use_config_qty_increments` <=> OLD.`use_config_qty_increments`) OR NOT(NEW.`qty_increments` <=> OLD.`qty_increments`) OR NOT(NEW.`use_config_enable_qty_inc` <=> OLD.`use_config_enable_qty_inc`) OR NOT(NEW.`enable_qty_increments` <=> OLD.`enable_qty_increments`) OR NOT(NEW.`is_decimal_divided` <=> OLD.`is_decimal_divided`) OR NOT(NEW.`website_id` <=> OLD.`website_id`)) THEN INSERT IGNORE INTO `[[dbprefix]]cataloginventory_stock_cl` (`entity_id`) VALUES (NEW.`product_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]cataloginventory_stock_item_after_delete` AFTER DELETE ON `[[dbprefix]]cataloginventory_stock_item` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]cataloginventory_stock_cl` (`entity_id`) VALUES (OLD.`product_id`);
END */;;
DELIMITER ;

DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalogrule_after_insert` AFTER INSERT ON `[[dbprefix]]catalogrule` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]catalogrule_rule_cl` (`entity_id`) VALUES (NEW.`rule_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalogrule_after_update` AFTER UPDATE ON `[[dbprefix]]catalogrule` FOR EACH ROW BEGIN
IF (NOT(NEW.`rule_id` <=> OLD.`rule_id`) OR NOT(NEW.`name` <=> OLD.`name`) OR NOT(NEW.`description` <=> OLD.`description`) OR NOT(NEW.`from_date` <=> OLD.`from_date`) OR NOT(NEW.`to_date` <=> OLD.`to_date`) OR NOT(NEW.`is_active` <=> OLD.`is_active`) OR NOT(NEW.`conditions_serialized` <=> OLD.`conditions_serialized`) OR NOT(NEW.`actions_serialized` <=> OLD.`actions_serialized`) OR NOT(NEW.`stop_rules_processing` <=> OLD.`stop_rules_processing`) OR NOT(NEW.`sort_order` <=> OLD.`sort_order`) OR NOT(NEW.`simple_action` <=> OLD.`simple_action`) OR NOT(NEW.`discount_amount` <=> OLD.`discount_amount`)) THEN INSERT IGNORE INTO `[[dbprefix]]catalogrule_rule_cl` (`entity_id`) VALUES (NEW.`rule_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalogrule_after_delete` AFTER DELETE ON `[[dbprefix]]catalogrule` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]catalogrule_rule_cl` (`entity_id`) VALUES (OLD.`rule_id`);
END */;;
DELIMITER ;

DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalogrule_product_price_after_insert` AFTER INSERT ON `[[dbprefix]]catalogrule_product_price` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]catalogsearch_fulltext_cl` (`entity_id`) VALUES (NEW.`product_id`);
INSERT IGNORE INTO `[[dbprefix]]catalog_product_price_cl` (`entity_id`) VALUES (NEW.`product_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalogrule_product_price_after_update` AFTER UPDATE ON `[[dbprefix]]catalogrule_product_price` FOR EACH ROW BEGIN
IF (NOT(NEW.`rule_product_price_id` <=> OLD.`rule_product_price_id`) OR NOT(NEW.`rule_date` <=> OLD.`rule_date`) OR NOT(NEW.`customer_group_id` <=> OLD.`customer_group_id`) OR NOT(NEW.`product_id` <=> OLD.`product_id`) OR NOT(NEW.`rule_price` <=> OLD.`rule_price`) OR NOT(NEW.`website_id` <=> OLD.`website_id`) OR NOT(NEW.`latest_start_date` <=> OLD.`latest_start_date`) OR NOT(NEW.`earliest_end_date` <=> OLD.`earliest_end_date`)) THEN INSERT IGNORE INTO `[[dbprefix]]catalogsearch_fulltext_cl` (`entity_id`) VALUES (NEW.`product_id`); END IF;
IF (NOT(NEW.`rule_product_price_id` <=> OLD.`rule_product_price_id`) OR NOT(NEW.`rule_date` <=> OLD.`rule_date`) OR NOT(NEW.`customer_group_id` <=> OLD.`customer_group_id`) OR NOT(NEW.`product_id` <=> OLD.`product_id`) OR NOT(NEW.`rule_price` <=> OLD.`rule_price`) OR NOT(NEW.`website_id` <=> OLD.`website_id`) OR NOT(NEW.`latest_start_date` <=> OLD.`latest_start_date`) OR NOT(NEW.`earliest_end_date` <=> OLD.`earliest_end_date`)) THEN INSERT IGNORE INTO `[[dbprefix]]catalog_product_price_cl` (`entity_id`) VALUES (NEW.`product_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]catalogrule_product_price_after_delete` AFTER DELETE ON `[[dbprefix]]catalogrule_product_price` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]catalogsearch_fulltext_cl` (`entity_id`) VALUES (OLD.`product_id`);
INSERT IGNORE INTO `[[dbprefix]]catalog_product_price_cl` (`entity_id`) VALUES (OLD.`product_id`);
END */;;
DELIMITER ;

DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]customer_address_entity_after_insert` AFTER INSERT ON `[[dbprefix]]customer_address_entity` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]customer_dummy_cl` (`entity_id`) VALUES (NEW.`parent_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]customer_address_entity_after_update` AFTER UPDATE ON `[[dbprefix]]customer_address_entity` FOR EACH ROW BEGIN
IF (NOT(NEW.`entity_id` <=> OLD.`entity_id`) OR NOT(NEW.`increment_id` <=> OLD.`increment_id`) OR NOT(NEW.`parent_id` <=> OLD.`parent_id`) OR NOT(NEW.`created_at` <=> OLD.`created_at`) OR NOT(NEW.`is_active` <=> OLD.`is_active`) OR NOT(NEW.`city` <=> OLD.`city`) OR NOT(NEW.`company` <=> OLD.`company`) OR NOT(NEW.`country_id` <=> OLD.`country_id`) OR NOT(NEW.`fax` <=> OLD.`fax`) OR NOT(NEW.`firstname` <=> OLD.`firstname`) OR NOT(NEW.`lastname` <=> OLD.`lastname`) OR NOT(NEW.`middlename` <=> OLD.`middlename`) OR NOT(NEW.`postcode` <=> OLD.`postcode`) OR NOT(NEW.`prefix` <=> OLD.`prefix`) OR NOT(NEW.`region` <=> OLD.`region`) OR NOT(NEW.`region_id` <=> OLD.`region_id`) OR NOT(NEW.`street` <=> OLD.`street`) OR NOT(NEW.`suffix` <=> OLD.`suffix`) OR NOT(NEW.`telephone` <=> OLD.`telephone`) OR NOT(NEW.`vat_id` <=> OLD.`vat_id`) OR NOT(NEW.`vat_is_valid` <=> OLD.`vat_is_valid`) OR NOT(NEW.`vat_request_date` <=> OLD.`vat_request_date`) OR NOT(NEW.`vat_request_id` <=> OLD.`vat_request_id`) OR NOT(NEW.`vat_request_success` <=> OLD.`vat_request_success`)) THEN INSERT IGNORE INTO `[[dbprefix]]customer_dummy_cl` (`entity_id`) VALUES (NEW.`parent_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]customer_address_entity_after_delete` AFTER DELETE ON `[[dbprefix]]customer_address_entity` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]customer_dummy_cl` (`entity_id`) VALUES (OLD.`parent_id`);
END */;;
DELIMITER ;

DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]customer_entity_after_insert` AFTER INSERT ON `[[dbprefix]]customer_entity` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]customer_dummy_cl` (`entity_id`) VALUES (NEW.`entity_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]customer_entity_after_update` AFTER UPDATE ON `[[dbprefix]]customer_entity` FOR EACH ROW BEGIN
IF (NOT(NEW.`entity_id` <=> OLD.`entity_id`) OR NOT(NEW.`website_id` <=> OLD.`website_id`) OR NOT(NEW.`email` <=> OLD.`email`) OR NOT(NEW.`group_id` <=> OLD.`group_id`) OR NOT(NEW.`increment_id` <=> OLD.`increment_id`) OR NOT(NEW.`store_id` <=> OLD.`store_id`) OR NOT(NEW.`created_at` <=> OLD.`created_at`) OR NOT(NEW.`is_active` <=> OLD.`is_active`) OR NOT(NEW.`disable_auto_group_change` <=> OLD.`disable_auto_group_change`) OR NOT(NEW.`created_in` <=> OLD.`created_in`) OR NOT(NEW.`prefix` <=> OLD.`prefix`) OR NOT(NEW.`firstname` <=> OLD.`firstname`) OR NOT(NEW.`middlename` <=> OLD.`middlename`) OR NOT(NEW.`lastname` <=> OLD.`lastname`) OR NOT(NEW.`suffix` <=> OLD.`suffix`) OR NOT(NEW.`dob` <=> OLD.`dob`) OR NOT(NEW.`password_hash` <=> OLD.`password_hash`) OR NOT(NEW.`rp_token` <=> OLD.`rp_token`) OR NOT(NEW.`rp_token_created_at` <=> OLD.`rp_token_created_at`) OR NOT(NEW.`default_billing` <=> OLD.`default_billing`) OR NOT(NEW.`default_shipping` <=> OLD.`default_shipping`) OR NOT(NEW.`taxvat` <=> OLD.`taxvat`) OR NOT(NEW.`confirmation` <=> OLD.`confirmation`) OR NOT(NEW.`gender` <=> OLD.`gender`) OR NOT(NEW.`failures_num` <=> OLD.`failures_num`) OR NOT(NEW.`first_failure` <=> OLD.`first_failure`) OR NOT(NEW.`lock_expires` <=> OLD.`lock_expires`) OR NOT(NEW.`session_cutoff` <=> OLD.`session_cutoff`)) THEN INSERT IGNORE INTO `[[dbprefix]]customer_dummy_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]customer_entity_after_delete` AFTER DELETE ON `[[dbprefix]]customer_entity` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]customer_dummy_cl` (`entity_id`) VALUES (OLD.`entity_id`);
END */;;
DELIMITER ;

DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]customer_entity_datetime_after_insert` AFTER INSERT ON `[[dbprefix]]customer_entity_datetime` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]customer_dummy_cl` (`entity_id`) VALUES (NEW.`entity_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]customer_entity_datetime_after_update` AFTER UPDATE ON `[[dbprefix]]customer_entity_datetime` FOR EACH ROW BEGIN
IF (NOT(NEW.`value_id` <=> OLD.`value_id`) OR NOT(NEW.`attribute_id` <=> OLD.`attribute_id`) OR NOT(NEW.`entity_id` <=> OLD.`entity_id`) OR NOT(NEW.`value` <=> OLD.`value`)) THEN INSERT IGNORE INTO `[[dbprefix]]customer_dummy_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]customer_entity_datetime_after_delete` AFTER DELETE ON `[[dbprefix]]customer_entity_datetime` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]customer_dummy_cl` (`entity_id`) VALUES (OLD.`entity_id`);
END */;;
DELIMITER ;

DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]customer_entity_decimal_after_insert` AFTER INSERT ON `[[dbprefix]]customer_entity_decimal` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]customer_dummy_cl` (`entity_id`) VALUES (NEW.`entity_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]customer_entity_decimal_after_update` AFTER UPDATE ON `[[dbprefix]]customer_entity_decimal` FOR EACH ROW BEGIN
IF (NOT(NEW.`value_id` <=> OLD.`value_id`) OR NOT(NEW.`attribute_id` <=> OLD.`attribute_id`) OR NOT(NEW.`entity_id` <=> OLD.`entity_id`) OR NOT(NEW.`value` <=> OLD.`value`)) THEN INSERT IGNORE INTO `[[dbprefix]]customer_dummy_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]customer_entity_decimal_after_delete` AFTER DELETE ON `[[dbprefix]]customer_entity_decimal` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]customer_dummy_cl` (`entity_id`) VALUES (OLD.`entity_id`);
END */;;
DELIMITER ;

DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]customer_entity_int_after_insert` AFTER INSERT ON `[[dbprefix]]customer_entity_int` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]customer_dummy_cl` (`entity_id`) VALUES (NEW.`entity_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]customer_entity_int_after_update` AFTER UPDATE ON `[[dbprefix]]customer_entity_int` FOR EACH ROW BEGIN
IF (NOT(NEW.`value_id` <=> OLD.`value_id`) OR NOT(NEW.`attribute_id` <=> OLD.`attribute_id`) OR NOT(NEW.`entity_id` <=> OLD.`entity_id`) OR NOT(NEW.`value` <=> OLD.`value`)) THEN INSERT IGNORE INTO `[[dbprefix]]customer_dummy_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]customer_entity_int_after_delete` AFTER DELETE ON `[[dbprefix]]customer_entity_int` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]customer_dummy_cl` (`entity_id`) VALUES (OLD.`entity_id`);
END */;;
DELIMITER ;

DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]inventory_source_item_after_insert` AFTER INSERT ON `[[dbprefix]]inventory_source_item` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]inventory_cl` (`entity_id`) VALUES (NEW.`source_item_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]inventory_source_item_after_update` AFTER UPDATE ON `[[dbprefix]]inventory_source_item` FOR EACH ROW BEGIN
IF (NOT(NEW.`source_item_id` <=> OLD.`source_item_id`) OR NOT(NEW.`source_code` <=> OLD.`source_code`) OR NOT(NEW.`sku` <=> OLD.`sku`) OR NOT(NEW.`quantity` <=> OLD.`quantity`) OR NOT(NEW.`status` <=> OLD.`status`)) THEN INSERT IGNORE INTO `[[dbprefix]]inventory_cl` (`entity_id`) VALUES (NEW.`source_item_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]inventory_source_item_after_delete` AFTER DELETE ON `[[dbprefix]]inventory_source_item` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]inventory_cl` (`entity_id`) VALUES (OLD.`source_item_id`);
END */;;
DELIMITER ;

DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]sales_order_after_insert` AFTER INSERT ON `[[dbprefix]]sales_order` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]sales_order_data_exporter_cl` (`entity_id`) VALUES (NEW.`entity_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]sales_order_after_update` AFTER UPDATE ON `[[dbprefix]]sales_order` FOR EACH ROW BEGIN
IF (NOT(NEW.`entity_id` <=> OLD.`entity_id`) OR NOT(NEW.`state` <=> OLD.`state`) OR NOT(NEW.`status` <=> OLD.`status`) OR NOT(NEW.`coupon_code` <=> OLD.`coupon_code`) OR NOT(NEW.`protect_code` <=> OLD.`protect_code`) OR NOT(NEW.`shipping_description` <=> OLD.`shipping_description`) OR NOT(NEW.`is_virtual` <=> OLD.`is_virtual`) OR NOT(NEW.`store_id` <=> OLD.`store_id`) OR NOT(NEW.`customer_id` <=> OLD.`customer_id`) OR NOT(NEW.`base_discount_amount` <=> OLD.`base_discount_amount`) OR NOT(NEW.`base_discount_canceled` <=> OLD.`base_discount_canceled`) OR NOT(NEW.`base_discount_invoiced` <=> OLD.`base_discount_invoiced`) OR NOT(NEW.`base_discount_refunded` <=> OLD.`base_discount_refunded`) OR NOT(NEW.`base_grand_total` <=> OLD.`base_grand_total`) OR NOT(NEW.`base_shipping_amount` <=> OLD.`base_shipping_amount`) OR NOT(NEW.`base_shipping_canceled` <=> OLD.`base_shipping_canceled`) OR NOT(NEW.`base_shipping_invoiced` <=> OLD.`base_shipping_invoiced`) OR NOT(NEW.`base_shipping_refunded` <=> OLD.`base_shipping_refunded`) OR NOT(NEW.`base_shipping_tax_amount` <=> OLD.`base_shipping_tax_amount`) OR NOT(NEW.`base_shipping_tax_refunded` <=> OLD.`base_shipping_tax_refunded`) OR NOT(NEW.`base_subtotal` <=> OLD.`base_subtotal`) OR NOT(NEW.`base_subtotal_canceled` <=> OLD.`base_subtotal_canceled`) OR NOT(NEW.`base_subtotal_invoiced` <=> OLD.`base_subtotal_invoiced`) OR NOT(NEW.`base_subtotal_refunded` <=> OLD.`base_subtotal_refunded`) OR NOT(NEW.`base_tax_amount` <=> OLD.`base_tax_amount`) OR NOT(NEW.`base_tax_canceled` <=> OLD.`base_tax_canceled`) OR NOT(NEW.`base_tax_invoiced` <=> OLD.`base_tax_invoiced`) OR NOT(NEW.`base_tax_refunded` <=> OLD.`base_tax_refunded`) OR NOT(NEW.`base_to_global_rate` <=> OLD.`base_to_global_rate`) OR NOT(NEW.`base_to_order_rate` <=> OLD.`base_to_order_rate`) OR NOT(NEW.`base_total_canceled` <=> OLD.`base_total_canceled`) OR NOT(NEW.`base_total_invoiced` <=> OLD.`base_total_invoiced`) OR NOT(NEW.`base_total_invoiced_cost` <=> OLD.`base_total_invoiced_cost`) OR NOT(NEW.`base_total_offline_refunded` <=> OLD.`base_total_offline_refunded`) OR NOT(NEW.`base_total_online_refunded` <=> OLD.`base_total_online_refunded`) OR NOT(NEW.`base_total_paid` <=> OLD.`base_total_paid`) OR NOT(NEW.`base_total_qty_ordered` <=> OLD.`base_total_qty_ordered`) OR NOT(NEW.`base_total_refunded` <=> OLD.`base_total_refunded`) OR NOT(NEW.`discount_amount` <=> OLD.`discount_amount`) OR NOT(NEW.`discount_canceled` <=> OLD.`discount_canceled`) OR NOT(NEW.`discount_invoiced` <=> OLD.`discount_invoiced`) OR NOT(NEW.`discount_refunded` <=> OLD.`discount_refunded`) OR NOT(NEW.`grand_total` <=> OLD.`grand_total`) OR NOT(NEW.`shipping_amount` <=> OLD.`shipping_amount`) OR NOT(NEW.`shipping_canceled` <=> OLD.`shipping_canceled`) OR NOT(NEW.`shipping_invoiced` <=> OLD.`shipping_invoiced`) OR NOT(NEW.`shipping_refunded` <=> OLD.`shipping_refunded`) OR NOT(NEW.`shipping_tax_amount` <=> OLD.`shipping_tax_amount`) OR NOT(NEW.`shipping_tax_refunded` <=> OLD.`shipping_tax_refunded`) OR NOT(NEW.`store_to_base_rate` <=> OLD.`store_to_base_rate`) OR NOT(NEW.`store_to_order_rate` <=> OLD.`store_to_order_rate`) OR NOT(NEW.`subtotal` <=> OLD.`subtotal`) OR NOT(NEW.`subtotal_canceled` <=> OLD.`subtotal_canceled`) OR NOT(NEW.`subtotal_invoiced` <=> OLD.`subtotal_invoiced`) OR NOT(NEW.`subtotal_refunded` <=> OLD.`subtotal_refunded`) OR NOT(NEW.`tax_amount` <=> OLD.`tax_amount`) OR NOT(NEW.`tax_canceled` <=> OLD.`tax_canceled`) OR NOT(NEW.`tax_invoiced` <=> OLD.`tax_invoiced`) OR NOT(NEW.`tax_refunded` <=> OLD.`tax_refunded`) OR NOT(NEW.`total_canceled` <=> OLD.`total_canceled`) OR NOT(NEW.`total_invoiced` <=> OLD.`total_invoiced`) OR NOT(NEW.`total_offline_refunded` <=> OLD.`total_offline_refunded`) OR NOT(NEW.`total_online_refunded` <=> OLD.`total_online_refunded`) OR NOT(NEW.`total_paid` <=> OLD.`total_paid`) OR NOT(NEW.`total_qty_ordered` <=> OLD.`total_qty_ordered`) OR NOT(NEW.`total_refunded` <=> OLD.`total_refunded`) OR NOT(NEW.`can_ship_partially` <=> OLD.`can_ship_partially`) OR NOT(NEW.`can_ship_partially_item` <=> OLD.`can_ship_partially_item`) OR NOT(NEW.`customer_is_guest` <=> OLD.`customer_is_guest`) OR NOT(NEW.`customer_note_notify` <=> OLD.`customer_note_notify`) OR NOT(NEW.`billing_address_id` <=> OLD.`billing_address_id`) OR NOT(NEW.`customer_group_id` <=> OLD.`customer_group_id`) OR NOT(NEW.`edit_increment` <=> OLD.`edit_increment`) OR NOT(NEW.`email_sent` <=> OLD.`email_sent`) OR NOT(NEW.`send_email` <=> OLD.`send_email`) OR NOT(NEW.`forced_shipment_with_invoice` <=> OLD.`forced_shipment_with_invoice`) OR NOT(NEW.`payment_auth_expiration` <=> OLD.`payment_auth_expiration`) OR NOT(NEW.`quote_address_id` <=> OLD.`quote_address_id`) OR NOT(NEW.`quote_id` <=> OLD.`quote_id`) OR NOT(NEW.`shipping_address_id` <=> OLD.`shipping_address_id`) OR NOT(NEW.`adjustment_negative` <=> OLD.`adjustment_negative`) OR NOT(NEW.`adjustment_positive` <=> OLD.`adjustment_positive`) OR NOT(NEW.`base_adjustment_negative` <=> OLD.`base_adjustment_negative`) OR NOT(NEW.`base_adjustment_positive` <=> OLD.`base_adjustment_positive`) OR NOT(NEW.`base_shipping_discount_amount` <=> OLD.`base_shipping_discount_amount`) OR NOT(NEW.`base_subtotal_incl_tax` <=> OLD.`base_subtotal_incl_tax`) OR NOT(NEW.`base_total_due` <=> OLD.`base_total_due`) OR NOT(NEW.`payment_authorization_amount` <=> OLD.`payment_authorization_amount`) OR NOT(NEW.`shipping_discount_amount` <=> OLD.`shipping_discount_amount`) OR NOT(NEW.`subtotal_incl_tax` <=> OLD.`subtotal_incl_tax`) OR NOT(NEW.`total_due` <=> OLD.`total_due`) OR NOT(NEW.`weight` <=> OLD.`weight`) OR NOT(NEW.`customer_dob` <=> OLD.`customer_dob`) OR NOT(NEW.`increment_id` <=> OLD.`increment_id`) OR NOT(NEW.`applied_rule_ids` <=> OLD.`applied_rule_ids`) OR NOT(NEW.`base_currency_code` <=> OLD.`base_currency_code`) OR NOT(NEW.`customer_email` <=> OLD.`customer_email`) OR NOT(NEW.`customer_firstname` <=> OLD.`customer_firstname`) OR NOT(NEW.`customer_lastname` <=> OLD.`customer_lastname`) OR NOT(NEW.`customer_middlename` <=> OLD.`customer_middlename`) OR NOT(NEW.`customer_prefix` <=> OLD.`customer_prefix`) OR NOT(NEW.`customer_suffix` <=> OLD.`customer_suffix`) OR NOT(NEW.`customer_taxvat` <=> OLD.`customer_taxvat`) OR NOT(NEW.`discount_description` <=> OLD.`discount_description`) OR NOT(NEW.`ext_customer_id` <=> OLD.`ext_customer_id`) OR NOT(NEW.`ext_order_id` <=> OLD.`ext_order_id`) OR NOT(NEW.`global_currency_code` <=> OLD.`global_currency_code`) OR NOT(NEW.`hold_before_state` <=> OLD.`hold_before_state`) OR NOT(NEW.`hold_before_status` <=> OLD.`hold_before_status`) OR NOT(NEW.`order_currency_code` <=> OLD.`order_currency_code`) OR NOT(NEW.`original_increment_id` <=> OLD.`original_increment_id`) OR NOT(NEW.`relation_child_id` <=> OLD.`relation_child_id`) OR NOT(NEW.`relation_child_real_id` <=> OLD.`relation_child_real_id`) OR NOT(NEW.`relation_parent_id` <=> OLD.`relation_parent_id`) OR NOT(NEW.`relation_parent_real_id` <=> OLD.`relation_parent_real_id`) OR NOT(NEW.`remote_ip` <=> OLD.`remote_ip`) OR NOT(NEW.`shipping_method` <=> OLD.`shipping_method`) OR NOT(NEW.`store_currency_code` <=> OLD.`store_currency_code`) OR NOT(NEW.`store_name` <=> OLD.`store_name`) OR NOT(NEW.`x_forwarded_for` <=> OLD.`x_forwarded_for`) OR NOT(NEW.`customer_note` <=> OLD.`customer_note`) OR NOT(NEW.`created_at` <=> OLD.`created_at`) OR NOT(NEW.`total_item_count` <=> OLD.`total_item_count`) OR NOT(NEW.`customer_gender` <=> OLD.`customer_gender`) OR NOT(NEW.`discount_tax_compensation_amount` <=> OLD.`discount_tax_compensation_amount`) OR NOT(NEW.`base_discount_tax_compensation_amount` <=> OLD.`base_discount_tax_compensation_amount`) OR NOT(NEW.`shipping_discount_tax_compensation_amount` <=> OLD.`shipping_discount_tax_compensation_amount`) OR NOT(NEW.`base_shipping_discount_tax_compensation_amnt` <=> OLD.`base_shipping_discount_tax_compensation_amnt`) OR NOT(NEW.`discount_tax_compensation_invoiced` <=> OLD.`discount_tax_compensation_invoiced`) OR NOT(NEW.`base_discount_tax_compensation_invoiced` <=> OLD.`base_discount_tax_compensation_invoiced`) OR NOT(NEW.`discount_tax_compensation_refunded` <=> OLD.`discount_tax_compensation_refunded`) OR NOT(NEW.`base_discount_tax_compensation_refunded` <=> OLD.`base_discount_tax_compensation_refunded`) OR NOT(NEW.`shipping_incl_tax` <=> OLD.`shipping_incl_tax`) OR NOT(NEW.`base_shipping_incl_tax` <=> OLD.`base_shipping_incl_tax`) OR NOT(NEW.`coupon_rule_name` <=> OLD.`coupon_rule_name`) OR NOT(NEW.`gift_message_id` <=> OLD.`gift_message_id`) OR NOT(NEW.`paypal_ipn_customer_notified` <=> OLD.`paypal_ipn_customer_notified`) OR NOT(NEW.`dispute_status` <=> OLD.`dispute_status`)) THEN INSERT IGNORE INTO `[[dbprefix]]sales_order_data_exporter_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]sales_order_after_delete` AFTER DELETE ON `[[dbprefix]]sales_order` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]sales_order_data_exporter_cl` (`entity_id`) VALUES (OLD.`entity_id`);
END */;;
DELIMITER ;

DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]sales_order_item_after_insert` AFTER INSERT ON `[[dbprefix]]sales_order_item` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]sales_order_data_exporter_cl` (`entity_id`) VALUES (NEW.`order_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]sales_order_item_after_update` AFTER UPDATE ON `[[dbprefix]]sales_order_item` FOR EACH ROW BEGIN
IF (NOT(NEW.`item_id` <=> OLD.`item_id`) OR NOT(NEW.`order_id` <=> OLD.`order_id`) OR NOT(NEW.`parent_item_id` <=> OLD.`parent_item_id`) OR NOT(NEW.`quote_item_id` <=> OLD.`quote_item_id`) OR NOT(NEW.`store_id` <=> OLD.`store_id`) OR NOT(NEW.`created_at` <=> OLD.`created_at`) OR NOT(NEW.`product_id` <=> OLD.`product_id`) OR NOT(NEW.`product_type` <=> OLD.`product_type`) OR NOT(NEW.`product_options` <=> OLD.`product_options`) OR NOT(NEW.`weight` <=> OLD.`weight`) OR NOT(NEW.`is_virtual` <=> OLD.`is_virtual`) OR NOT(NEW.`sku` <=> OLD.`sku`) OR NOT(NEW.`name` <=> OLD.`name`) OR NOT(NEW.`description` <=> OLD.`description`) OR NOT(NEW.`applied_rule_ids` <=> OLD.`applied_rule_ids`) OR NOT(NEW.`additional_data` <=> OLD.`additional_data`) OR NOT(NEW.`is_qty_decimal` <=> OLD.`is_qty_decimal`) OR NOT(NEW.`no_discount` <=> OLD.`no_discount`) OR NOT(NEW.`qty_backordered` <=> OLD.`qty_backordered`) OR NOT(NEW.`qty_canceled` <=> OLD.`qty_canceled`) OR NOT(NEW.`qty_invoiced` <=> OLD.`qty_invoiced`) OR NOT(NEW.`qty_ordered` <=> OLD.`qty_ordered`) OR NOT(NEW.`qty_refunded` <=> OLD.`qty_refunded`) OR NOT(NEW.`qty_shipped` <=> OLD.`qty_shipped`) OR NOT(NEW.`base_cost` <=> OLD.`base_cost`) OR NOT(NEW.`price` <=> OLD.`price`) OR NOT(NEW.`base_price` <=> OLD.`base_price`) OR NOT(NEW.`original_price` <=> OLD.`original_price`) OR NOT(NEW.`base_original_price` <=> OLD.`base_original_price`) OR NOT(NEW.`tax_percent` <=> OLD.`tax_percent`) OR NOT(NEW.`tax_amount` <=> OLD.`tax_amount`) OR NOT(NEW.`base_tax_amount` <=> OLD.`base_tax_amount`) OR NOT(NEW.`tax_invoiced` <=> OLD.`tax_invoiced`) OR NOT(NEW.`base_tax_invoiced` <=> OLD.`base_tax_invoiced`) OR NOT(NEW.`discount_percent` <=> OLD.`discount_percent`) OR NOT(NEW.`discount_amount` <=> OLD.`discount_amount`) OR NOT(NEW.`base_discount_amount` <=> OLD.`base_discount_amount`) OR NOT(NEW.`discount_invoiced` <=> OLD.`discount_invoiced`) OR NOT(NEW.`base_discount_invoiced` <=> OLD.`base_discount_invoiced`) OR NOT(NEW.`amount_refunded` <=> OLD.`amount_refunded`) OR NOT(NEW.`base_amount_refunded` <=> OLD.`base_amount_refunded`) OR NOT(NEW.`row_total` <=> OLD.`row_total`) OR NOT(NEW.`base_row_total` <=> OLD.`base_row_total`) OR NOT(NEW.`row_invoiced` <=> OLD.`row_invoiced`) OR NOT(NEW.`base_row_invoiced` <=> OLD.`base_row_invoiced`) OR NOT(NEW.`row_weight` <=> OLD.`row_weight`) OR NOT(NEW.`base_tax_before_discount` <=> OLD.`base_tax_before_discount`) OR NOT(NEW.`tax_before_discount` <=> OLD.`tax_before_discount`) OR NOT(NEW.`ext_order_item_id` <=> OLD.`ext_order_item_id`) OR NOT(NEW.`locked_do_invoice` <=> OLD.`locked_do_invoice`) OR NOT(NEW.`locked_do_ship` <=> OLD.`locked_do_ship`) OR NOT(NEW.`price_incl_tax` <=> OLD.`price_incl_tax`) OR NOT(NEW.`base_price_incl_tax` <=> OLD.`base_price_incl_tax`) OR NOT(NEW.`row_total_incl_tax` <=> OLD.`row_total_incl_tax`) OR NOT(NEW.`base_row_total_incl_tax` <=> OLD.`base_row_total_incl_tax`) OR NOT(NEW.`discount_tax_compensation_amount` <=> OLD.`discount_tax_compensation_amount`) OR NOT(NEW.`base_discount_tax_compensation_amount` <=> OLD.`base_discount_tax_compensation_amount`) OR NOT(NEW.`discount_tax_compensation_invoiced` <=> OLD.`discount_tax_compensation_invoiced`) OR NOT(NEW.`base_discount_tax_compensation_invoiced` <=> OLD.`base_discount_tax_compensation_invoiced`) OR NOT(NEW.`discount_tax_compensation_refunded` <=> OLD.`discount_tax_compensation_refunded`) OR NOT(NEW.`base_discount_tax_compensation_refunded` <=> OLD.`base_discount_tax_compensation_refunded`) OR NOT(NEW.`tax_canceled` <=> OLD.`tax_canceled`) OR NOT(NEW.`discount_tax_compensation_canceled` <=> OLD.`discount_tax_compensation_canceled`) OR NOT(NEW.`tax_refunded` <=> OLD.`tax_refunded`) OR NOT(NEW.`base_tax_refunded` <=> OLD.`base_tax_refunded`) OR NOT(NEW.`discount_refunded` <=> OLD.`discount_refunded`) OR NOT(NEW.`base_discount_refunded` <=> OLD.`base_discount_refunded`) OR NOT(NEW.`gift_message_id` <=> OLD.`gift_message_id`) OR NOT(NEW.`gift_message_available` <=> OLD.`gift_message_available`) OR NOT(NEW.`free_shipping` <=> OLD.`free_shipping`) OR NOT(NEW.`weee_tax_applied` <=> OLD.`weee_tax_applied`) OR NOT(NEW.`weee_tax_applied_amount` <=> OLD.`weee_tax_applied_amount`) OR NOT(NEW.`weee_tax_applied_row_amount` <=> OLD.`weee_tax_applied_row_amount`) OR NOT(NEW.`weee_tax_disposition` <=> OLD.`weee_tax_disposition`) OR NOT(NEW.`weee_tax_row_disposition` <=> OLD.`weee_tax_row_disposition`) OR NOT(NEW.`base_weee_tax_applied_amount` <=> OLD.`base_weee_tax_applied_amount`) OR NOT(NEW.`base_weee_tax_applied_row_amnt` <=> OLD.`base_weee_tax_applied_row_amnt`) OR NOT(NEW.`base_weee_tax_disposition` <=> OLD.`base_weee_tax_disposition`) OR NOT(NEW.`base_weee_tax_row_disposition` <=> OLD.`base_weee_tax_row_disposition`)) THEN INSERT IGNORE INTO `[[dbprefix]]sales_order_data_exporter_cl` (`entity_id`) VALUES (NEW.`order_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]sales_order_item_after_delete` AFTER DELETE ON `[[dbprefix]]sales_order_item` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]sales_order_data_exporter_cl` (`entity_id`) VALUES (OLD.`order_id`);
END */;;
DELIMITER ;

DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]sales_order_status_after_insert` AFTER INSERT ON `[[dbprefix]]sales_order_status` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]sales_order_status_data_exporter_cl` (`entity_id`) VALUES (NEW.`status`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]sales_order_status_after_update` AFTER UPDATE ON `[[dbprefix]]sales_order_status` FOR EACH ROW BEGIN
IF (NOT(NEW.`status` <=> OLD.`status`) OR NOT(NEW.`label` <=> OLD.`label`)) THEN INSERT IGNORE INTO `[[dbprefix]]sales_order_status_data_exporter_cl` (`entity_id`) VALUES (NEW.`status`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]sales_order_status_after_delete` AFTER DELETE ON `[[dbprefix]]sales_order_status` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]sales_order_status_data_exporter_cl` (`entity_id`) VALUES (OLD.`status`);
END */;;
DELIMITER ;

DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]sales_payment_transaction_after_insert` AFTER INSERT ON `[[dbprefix]]sales_payment_transaction` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]sales_order_data_exporter_cl` (`entity_id`) VALUES (NEW.`order_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]sales_payment_transaction_after_update` AFTER UPDATE ON `[[dbprefix]]sales_payment_transaction` FOR EACH ROW BEGIN
IF (NOT(NEW.`transaction_id` <=> OLD.`transaction_id`) OR NOT(NEW.`parent_id` <=> OLD.`parent_id`) OR NOT(NEW.`order_id` <=> OLD.`order_id`) OR NOT(NEW.`payment_id` <=> OLD.`payment_id`) OR NOT(NEW.`txn_id` <=> OLD.`txn_id`) OR NOT(NEW.`parent_txn_id` <=> OLD.`parent_txn_id`) OR NOT(NEW.`txn_type` <=> OLD.`txn_type`) OR NOT(NEW.`is_closed` <=> OLD.`is_closed`) OR NOT(NEW.`additional_information` <=> OLD.`additional_information`) OR NOT(NEW.`created_at` <=> OLD.`created_at`)) THEN INSERT IGNORE INTO `[[dbprefix]]sales_order_data_exporter_cl` (`entity_id`) VALUES (NEW.`order_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]sales_payment_transaction_after_delete` AFTER DELETE ON `[[dbprefix]]sales_payment_transaction` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]sales_order_data_exporter_cl` (`entity_id`) VALUES (OLD.`order_id`);
END */;;
DELIMITER ;

DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]store_after_insert` AFTER INSERT ON `[[dbprefix]]store` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]store_data_exporter_cl` (`entity_id`) VALUES (NEW.`website_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]store_after_update` AFTER UPDATE ON `[[dbprefix]]store` FOR EACH ROW BEGIN
IF (NOT(NEW.`store_id` <=> OLD.`store_id`) OR NOT(NEW.`code` <=> OLD.`code`) OR NOT(NEW.`website_id` <=> OLD.`website_id`) OR NOT(NEW.`group_id` <=> OLD.`group_id`) OR NOT(NEW.`name` <=> OLD.`name`) OR NOT(NEW.`sort_order` <=> OLD.`sort_order`) OR NOT(NEW.`is_active` <=> OLD.`is_active`)) THEN INSERT IGNORE INTO `[[dbprefix]]store_data_exporter_cl` (`entity_id`) VALUES (NEW.`website_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]store_after_delete` AFTER DELETE ON `[[dbprefix]]store` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]store_data_exporter_cl` (`entity_id`) VALUES (OLD.`website_id`);
END */;;
DELIMITER ;

DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]store_group_after_insert` AFTER INSERT ON `[[dbprefix]]store_group` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]store_data_exporter_cl` (`entity_id`) VALUES (NEW.`website_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]store_group_after_update` AFTER UPDATE ON `[[dbprefix]]store_group` FOR EACH ROW BEGIN
IF (NOT(NEW.`group_id` <=> OLD.`group_id`) OR NOT(NEW.`website_id` <=> OLD.`website_id`) OR NOT(NEW.`name` <=> OLD.`name`) OR NOT(NEW.`root_category_id` <=> OLD.`root_category_id`) OR NOT(NEW.`default_store_id` <=> OLD.`default_store_id`) OR NOT(NEW.`code` <=> OLD.`code`)) THEN INSERT IGNORE INTO `[[dbprefix]]store_data_exporter_cl` (`entity_id`) VALUES (NEW.`website_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]store_group_after_delete` AFTER DELETE ON `[[dbprefix]]store_group` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]store_data_exporter_cl` (`entity_id`) VALUES (OLD.`website_id`);
END */;;
DELIMITER ;

DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]store_website_after_insert` AFTER INSERT ON `[[dbprefix]]store_website` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]store_data_exporter_cl` (`entity_id`) VALUES (NEW.`website_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]store_website_after_update` AFTER UPDATE ON `[[dbprefix]]store_website` FOR EACH ROW BEGIN
IF (NOT(NEW.`website_id` <=> OLD.`website_id`) OR NOT(NEW.`code` <=> OLD.`code`) OR NOT(NEW.`name` <=> OLD.`name`) OR NOT(NEW.`sort_order` <=> OLD.`sort_order`) OR NOT(NEW.`default_group_id` <=> OLD.`default_group_id`) OR NOT(NEW.`is_default` <=> OLD.`is_default`)) THEN INSERT IGNORE INTO `[[dbprefix]]store_data_exporter_cl` (`entity_id`) VALUES (NEW.`website_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 */ /*!50003 TRIGGER `trg_[[dbprefix]]store_website_after_delete` AFTER DELETE ON `[[dbprefix]]store_website` FOR EACH ROW BEGIN
INSERT IGNORE INTO `[[dbprefix]]store_data_exporter_cl` (`entity_id`) VALUES (OLD.`website_id`);
END */;;
DELIMITER ;
