--
-- Host: localhost    Database: kingdom
-- ------------------------------------------------------


--
-- Table structure for table `admin_analytics_usage_version_log`
--

CREATE TABLE `admin_analytics_usage_version_log` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Log ID',
  `last_viewed_in_version` varchar(50) NOT NULL COMMENT 'Viewer last viewed on product version',
  PRIMARY KEY (`id`),
  UNIQUE KEY `ADMIN_ANALYTICS_USAGE_VERSION_LOG_LAST_VIEWED_IN_VERSION` (`last_viewed_in_version`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COMMENT='Admin Notification Viewer Log Table';

--
-- Table structure for table `admin_passwords`
--

CREATE TABLE `admin_passwords` (
  `password_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Password ID',
  `user_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'User ID',
  `password_hash` varchar(255) DEFAULT NULL COMMENT 'Password Hash',
  `expires` int unsigned NOT NULL DEFAULT '0' COMMENT 'Deprecated',
  `last_updated` int unsigned NOT NULL DEFAULT '0' COMMENT 'Last Updated',
  PRIMARY KEY (`password_id`),
  KEY `ADMIN_PASSWORDS_USER_ID` (`user_id`),
  CONSTRAINT `ADMIN_PASSWORDS_USER_ID_ADMIN_USER_USER_ID` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`user_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=218 DEFAULT CHARSET=utf8mb3 COMMENT='Admin Passwords';

--
-- Table structure for table `admin_system_messages`
--

CREATE TABLE `admin_system_messages` (
  `identity` varchar(100) NOT NULL COMMENT 'Message ID',
  `severity` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Problem type',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Create date',
  PRIMARY KEY (`identity`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Admin System Messages';

--
-- Table structure for table `admin_user`
--

CREATE TABLE `admin_user` (
  `user_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'User ID',
  `firstname` varchar(32) DEFAULT NULL COMMENT 'User First Name',
  `lastname` varchar(32) DEFAULT NULL COMMENT 'User Last Name',
  `email` varchar(128) DEFAULT NULL COMMENT 'User Email',
  `username` varchar(40) DEFAULT NULL COMMENT 'User Login',
  `password` varchar(255) NOT NULL COMMENT 'User Password',
  `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'User Created Time',
  `modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'User Modified Time',
  `logdate` timestamp NULL DEFAULT NULL COMMENT 'User Last Login Time',
  `lognum` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'User Login Number',
  `reload_acl_flag` smallint NOT NULL DEFAULT '0' COMMENT 'Reload ACL',
  `is_active` smallint NOT NULL DEFAULT '1' COMMENT 'User Is Active',
  `extra` text COMMENT 'User Extra Data',
  `rp_token` text COMMENT 'Reset Password Link Token',
  `rp_token_created_at` timestamp NULL DEFAULT NULL COMMENT 'Reset Password Link Token Creation Date',
  `interface_locale` varchar(16) NOT NULL DEFAULT 'en_US' COMMENT 'Backend interface locale',
  `failures_num` smallint DEFAULT '0' COMMENT 'Failure Number',
  `first_failure` timestamp NULL DEFAULT NULL COMMENT 'First Failure',
  `lock_expires` timestamp NULL DEFAULT NULL COMMENT 'Expiration Lock Dates',
  PRIMARY KEY (`user_id`),
  UNIQUE KEY `ADMIN_USER_USERNAME` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=98 DEFAULT CHARSET=utf8mb3 COMMENT='Admin User Table';

--
-- Table structure for table `admin_user_expiration`
--

CREATE TABLE `admin_user_expiration` (
  `user_id` int unsigned NOT NULL COMMENT 'User ID',
  `expires_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'User Expiration Date',
  PRIMARY KEY (`user_id`),
  CONSTRAINT `ADMIN_USER_EXPIRATION_USER_ID_ADMIN_USER_USER_ID` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`user_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Admin User expiration dates table';

--
-- Table structure for table `admin_user_session`
--

CREATE TABLE `admin_user_session` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `session_id` varchar(1) DEFAULT NULL COMMENT 'Deprecated: Session ID value no longer used',
  `user_id` int unsigned DEFAULT NULL COMMENT 'Admin User ID',
  `status` smallint unsigned NOT NULL DEFAULT '1' COMMENT 'Current Session status',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Created Time',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Update Time',
  `ip` varchar(15) NOT NULL COMMENT 'Remote user IP',
  PRIMARY KEY (`id`),
  KEY `ADMIN_USER_SESSION_SESSION_ID` (`session_id`),
  KEY `ADMIN_USER_SESSION_USER_ID` (`user_id`),
  CONSTRAINT `ADMIN_USER_SESSION_USER_ID_ADMIN_USER_USER_ID` FOREIGN KEY (`user_id`) REFERENCES `admin_user` (`user_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2409 DEFAULT CHARSET=utf8mb3 COMMENT='Admin User sessions table';

--
-- Table structure for table `adminnotification_inbox`
--

CREATE TABLE `adminnotification_inbox` (
  `notification_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Notification ID',
  `severity` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Problem type',
  `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Create date',
  `title` varchar(255) NOT NULL COMMENT 'Title',
  `description` text COMMENT 'Description',
  `url` varchar(255) DEFAULT NULL COMMENT 'Url',
  `is_read` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Flag if notification read',
  `is_remove` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Flag if notification might be removed',
  `is_amasty` smallint NOT NULL DEFAULT '0' COMMENT 'Is Amasty Notification',
  `expiration_date` datetime DEFAULT NULL COMMENT 'Expiration Date',
  `image_url` varchar(255) DEFAULT NULL COMMENT 'Image Url',
  PRIMARY KEY (`notification_id`),
  KEY `ADMINNOTIFICATION_INBOX_SEVERITY` (`severity`),
  KEY `ADMINNOTIFICATION_INBOX_IS_READ` (`is_read`),
  KEY `ADMINNOTIFICATION_INBOX_IS_REMOVE` (`is_remove`)
) ENGINE=InnoDB AUTO_INCREMENT=76 DEFAULT CHARSET=utf8mb3 COMMENT='Adminnotification Inbox';

--
-- Table structure for table `adobe_stock_asset`
--

CREATE TABLE `adobe_stock_asset` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `media_gallery_id` int unsigned DEFAULT NULL COMMENT 'Media gallery ID',
  `category_id` int unsigned DEFAULT NULL COMMENT 'Category ID',
  `creator_id` int unsigned DEFAULT NULL COMMENT 'Creator ID',
  `is_licensed` int unsigned NOT NULL DEFAULT '0' COMMENT 'Is Licensed',
  `creation_date` varchar(255) DEFAULT NULL COMMENT 'Creation Date',
  PRIMARY KEY (`id`),
  KEY `ADOBE_STOCK_ASSET_MEDIA_GALLERY_ID_MEDIA_GALLERY_ASSET_ID` (`media_gallery_id`),
  KEY `ADOBE_STOCK_ASSET_ID` (`id`),
  KEY `ADOBE_STOCK_ASSET_CATEGORY_ID` (`category_id`),
  KEY `ADOBE_STOCK_ASSET_CREATOR_ID` (`creator_id`),
  CONSTRAINT `ADOBE_STOCK_ASSET_CATEGORY_ID_ADOBE_STOCK_CATEGORY_ID` FOREIGN KEY (`category_id`) REFERENCES `adobe_stock_category` (`id`) ON DELETE SET NULL,
  CONSTRAINT `ADOBE_STOCK_ASSET_CREATOR_ID_ADOBE_STOCK_CREATOR_ID` FOREIGN KEY (`creator_id`) REFERENCES `adobe_stock_creator` (`id`) ON DELETE SET NULL,
  CONSTRAINT `ADOBE_STOCK_ASSET_MEDIA_GALLERY_ID_MEDIA_GALLERY_ASSET_ID` FOREIGN KEY (`media_gallery_id`) REFERENCES `media_gallery_asset` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Adobe Stock Asset';

--
-- Table structure for table `adobe_stock_category`
--

CREATE TABLE `adobe_stock_category` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `name` varchar(255) DEFAULT NULL COMMENT 'Name',
  PRIMARY KEY (`id`),
  KEY `ADOBE_STOCK_CATEGORY_ID` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Adobe Stock Category';

--
-- Table structure for table `adobe_stock_creator`
--

CREATE TABLE `adobe_stock_creator` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `name` varchar(255) DEFAULT NULL COMMENT 'Asset creator''s name',
  PRIMARY KEY (`id`),
  KEY `ADOBE_STOCK_CREATOR_ID` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Adobe Stock Creator';

--
-- Table structure for table `adobe_user_profile`
--

CREATE TABLE `adobe_user_profile` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `admin_user_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Admin User Id',
  `name` varchar(255) NOT NULL COMMENT 'Display Name',
  `email` varchar(255) NOT NULL COMMENT 'user profile email',
  `image` varchar(255) NOT NULL COMMENT 'user profile avatar',
  `account_type` varchar(255) DEFAULT NULL COMMENT 'Account Type',
  `access_token` text COMMENT 'Access Token',
  `refresh_token` text COMMENT 'Refresh Token',
  `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',
  `access_token_expires_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Access Token Expires At',
  PRIMARY KEY (`id`),
  KEY `ADOBE_USER_PROFILE_ADMIN_USER_ID_ADMIN_USER_USER_ID` (`admin_user_id`),
  KEY `ADOBE_USER_PROFILE_ID` (`id`),
  CONSTRAINT `ADOBE_USER_PROFILE_ADMIN_USER_ID_ADMIN_USER_USER_ID` FOREIGN KEY (`admin_user_id`) REFERENCES `admin_user` (`user_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Adobe IMS User Profile';

--
-- Table structure for table `amasty_acart_attribute`
--

CREATE TABLE `amasty_acart_attribute` (
  `attr_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Attribute Id',
  `rule_id` int unsigned NOT NULL COMMENT 'Rule Id',
  `code` varchar(255) NOT NULL COMMENT 'Email',
  PRIMARY KEY (`attr_id`),
  KEY `AMASTY_ACART_ATTRIBUTE_RULE_ID_AMASTY_ACART_RULE_RULE_ID` (`rule_id`),
  CONSTRAINT `AMASTY_ACART_ATTRIBUTE_RULE_ID_AMASTY_ACART_RULE_RULE_ID` FOREIGN KEY (`rule_id`) REFERENCES `amasty_acart_rule` (`rule_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8mb3 COMMENT='Amasty Acart Attribute';

--
-- Table structure for table `amasty_acart_blacklist`
--

CREATE TABLE `amasty_acart_blacklist` (
  `blacklist_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Blacklist Id',
  `customer_email` varchar(255) DEFAULT NULL COMMENT 'Customer Email',
  PRIMARY KEY (`blacklist_id`),
  UNIQUE KEY `AMASTY_ACART_BLACKLIST_CUSTOMER_EMAIL` (`customer_email`)
) ENGINE=InnoDB AUTO_INCREMENT=42 DEFAULT CHARSET=utf8mb3 COMMENT='amasty_acart_blacklist';

--
-- Table structure for table `amasty_acart_email_template`
--

CREATE TABLE `amasty_acart_email_template` (
  `template_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Template Id',
  `schedule_id` int unsigned NOT NULL COMMENT 'Schedule Id',
  `template_code` varchar(150) NOT NULL DEFAULT '' COMMENT 'Template Name',
  `template_text` text NOT NULL COMMENT 'Template Content',
  `template_styles` text COMMENT 'Template Styles',
  `template_type` int unsigned DEFAULT NULL COMMENT 'Template Type',
  `template_subject` varchar(200) NOT NULL COMMENT 'Template Subject',
  `orig_template_variables` text COMMENT 'Original Template Variables',
  `is_legacy` tinyint(1) NOT NULL COMMENT 'Is Legacy',
  PRIMARY KEY (`template_id`),
  UNIQUE KEY `AMASTY_ACART_EMAIL_TEMPLATE_TEMPLATE_CODE` (`template_code`),
  KEY `FK_F4B32E69000BFF66607568C4933D66BA` (`schedule_id`),
  CONSTRAINT `FK_F4B32E69000BFF66607568C4933D66BA` FOREIGN KEY (`schedule_id`) REFERENCES `amasty_acart_schedule` (`schedule_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb3 COMMENT='Amasty Acart Email Template Table';

--
-- Table structure for table `amasty_acart_guest_customer_quotes`
--

CREATE TABLE `amasty_acart_guest_customer_quotes` (
  `customer_id` int unsigned NOT NULL COMMENT 'Customer Id',
  `quote_id` int unsigned NOT NULL COMMENT 'Quote Id',
  `orig_quote_id` int unsigned NOT NULL COMMENT 'Original Quote Id',
  PRIMARY KEY (`customer_id`,`quote_id`,`orig_quote_id`),
  KEY `AMASTY_ACART_GUEST_CUSTOMER_QUOTES_QUOTE_ID_QUOTE_ENTITY_ID` (`quote_id`),
  KEY `AMASTY_ACART_GUEST_CUSTOMER_QUOTES_ORIG_QUOTE_ID_QUOTE_ENTITY_ID` (`orig_quote_id`),
  CONSTRAINT `AMASTY_ACART_GUEST_CSTR_QUOTES_CSTR_ID_CSTR_ENTT_ENTT_ID` FOREIGN KEY (`customer_id`) REFERENCES `customer_entity` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `AMASTY_ACART_GUEST_CUSTOMER_QUOTES_ORIG_QUOTE_ID_QUOTE_ENTITY_ID` FOREIGN KEY (`orig_quote_id`) REFERENCES `quote` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `AMASTY_ACART_GUEST_CUSTOMER_QUOTES_QUOTE_ID_QUOTE_ENTITY_ID` FOREIGN KEY (`quote_id`) REFERENCES `quote` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Amasty Acart Guest Customer Quotes Table';

--
-- Table structure for table `amasty_acart_history`
--

CREATE TABLE `amasty_acart_history` (
  `history_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'History Id',
  `rule_quote_id` int unsigned DEFAULT NULL COMMENT 'Rule Quote ID',
  `schedule_id` int unsigned DEFAULT NULL COMMENT 'Schedule ID',
  `status` varchar(32) DEFAULT NULL COMMENT 'Status',
  `public_key` varchar(32) DEFAULT NULL COMMENT 'Public Key',
  `email_subject` varchar(255) DEFAULT NULL COMMENT 'Email Subject',
  `email_body` mediumtext COMMENT 'Email Body',
  `sales_rule_id` int unsigned DEFAULT NULL COMMENT 'Sales Rule ID',
  `sales_rule_coupon_id` int unsigned DEFAULT NULL COMMENT 'Sales Rule Coupon ID',
  `sales_rule_coupon` varchar(255) DEFAULT NULL COMMENT 'Sales Rule Coupon',
  `scheduled_at` timestamp NULL DEFAULT NULL COMMENT 'Dcheduled Date',
  `executed_at` timestamp NULL DEFAULT NULL COMMENT 'Executed Date',
  `finished_at` timestamp NULL DEFAULT NULL COMMENT 'Finished Date',
  `sales_rule_coupon_expiration_date` timestamp NULL DEFAULT NULL COMMENT 'Expiration Date',
  `opened` int NOT NULL DEFAULT '0' COMMENT 'Email open counter',
  PRIMARY KEY (`history_id`),
  KEY `FK_819FFF7D7B22D8B71DEF484849FC07B4` (`rule_quote_id`),
  KEY `AMASTY_ACART_HISTORY_SALES_RULE_ID_SALESRULE_RULE_ID` (`sales_rule_id`),
  KEY `FK_CF4615181E7052E66CC2B0BB51853F2F` (`sales_rule_coupon_id`),
  KEY `FK_A2FF7CCCBC2589647A3585E511AE08D7` (`schedule_id`),
  KEY `AMASTY_ACART_HISTORY_STATUS` (`status`),
  CONSTRAINT `AMASTY_ACART_HISTORY_SALES_RULE_ID_SALESRULE_RULE_ID` FOREIGN KEY (`sales_rule_id`) REFERENCES `salesrule` (`rule_id`) ON DELETE SET NULL,
  CONSTRAINT `FK_819FFF7D7B22D8B71DEF484849FC07B4` FOREIGN KEY (`rule_quote_id`) REFERENCES `amasty_acart_rule_quote` (`rule_quote_id`) ON DELETE CASCADE,
  CONSTRAINT `FK_A2FF7CCCBC2589647A3585E511AE08D7` FOREIGN KEY (`schedule_id`) REFERENCES `amasty_acart_schedule` (`schedule_id`) ON DELETE SET NULL,
  CONSTRAINT `FK_CF4615181E7052E66CC2B0BB51853F2F` FOREIGN KEY (`sales_rule_coupon_id`) REFERENCES `salesrule_coupon` (`coupon_id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=3532 DEFAULT CHARSET=utf8mb3 COMMENT='amasty_acart_history';

--
-- Table structure for table `amasty_acart_history_details`
--

CREATE TABLE `amasty_acart_history_details` (
  `detail_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Detail Id',
  `history_id` int unsigned NOT NULL COMMENT 'Associated History Id',
  `product_name` text NOT NULL COMMENT 'Product Name',
  `sku` text NOT NULL COMMENT 'Product SKU',
  `price` decimal(10,0) unsigned NOT NULL COMMENT 'Product Price',
  `qty` int unsigned NOT NULL COMMENT 'Product Qty',
  `store_id` int unsigned NOT NULL COMMENT 'Associated Store ID to quote item',
  `currency_code` text NOT NULL COMMENT 'Associated currency code to quote item',
  PRIMARY KEY (`detail_id`),
  KEY `FK_C7E6BE039262C00423961543E039EC67` (`history_id`),
  CONSTRAINT `FK_C7E6BE039262C00423961543E039EC67` FOREIGN KEY (`history_id`) REFERENCES `amasty_acart_history` (`history_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4727 DEFAULT CHARSET=utf8mb3 COMMENT='Amasty Acart History Product Details Table';

--
-- Table structure for table `amasty_acart_quote_email`
--

CREATE TABLE `amasty_acart_quote_email` (
  `quote_email_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Quote Email Id',
  `quote_id` int unsigned NOT NULL COMMENT 'Quote ID',
  `customer_email` varchar(255) DEFAULT NULL COMMENT 'Customer Email',
  PRIMARY KEY (`quote_email_id`),
  UNIQUE KEY `AMASTY_ACART_QUOTE_EMAIL_QUOTE_ID` (`quote_id`),
  CONSTRAINT `AMASTY_ACART_QUOTE_EMAIL_QUOTE_ID_QUOTE_ENTITY_ID` FOREIGN KEY (`quote_id`) REFERENCES `quote` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=17028 DEFAULT CHARSET=utf8mb3 COMMENT='amasty_acart_quote_email';

--
-- Table structure for table `amasty_acart_rule`
--

CREATE TABLE `amasty_acart_rule` (
  `rule_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Rule Id',
  `name` varchar(255) DEFAULT NULL COMMENT 'Name',
  `is_active` smallint NOT NULL DEFAULT '0' COMMENT 'Is Active',
  `priority` smallint NOT NULL DEFAULT '1' COMMENT 'Priority',
  `conditions_serialized` mediumtext COMMENT 'Conditions Serialized',
  `cancel_condition` varchar(255) NOT NULL DEFAULT '' COMMENT 'Cancel Condition',
  `utm_source` varchar(255) DEFAULT NULL COMMENT 'Utm Source',
  `utm_medium` varchar(255) DEFAULT NULL COMMENT 'Utm Medium',
  `utm_term` varchar(255) DEFAULT NULL COMMENT 'Utm Term',
  `utm_content` varchar(255) DEFAULT NULL COMMENT 'Utm Content',
  `utm_campaign` varchar(255) DEFAULT NULL COMMENT 'Utm Campaign',
  PRIMARY KEY (`rule_id`),
  FULLTEXT KEY `FTI_20E92A70B7022B6D3721BA343A07BC85` (`name`,`utm_source`,`utm_medium`,`utm_term`,`utm_content`,`utm_campaign`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb3 COMMENT='Amasty Acart Rule Grid';

--
-- Table structure for table `amasty_acart_rule_customer_group`
--

CREATE TABLE `amasty_acart_rule_customer_group` (
  `rule_customer_group_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Rule-Customer Relation Id',
  `rule_id` int unsigned NOT NULL COMMENT 'Rule Id',
  `customer_group_id` int unsigned NOT NULL COMMENT 'Customer Group Id',
  PRIMARY KEY (`rule_customer_group_id`),
  KEY `AMASTY_ACART_RULE_CSTR_GROUP_RULE_ID_AMASTY_ACART_RULE_RULE_ID` (`rule_id`),
  KEY `FK_898E5863210B2932733BE8D92E7347DC` (`customer_group_id`),
  CONSTRAINT `AMASTY_ACART_RULE_CSTR_GROUP_RULE_ID_AMASTY_ACART_RULE_RULE_ID` FOREIGN KEY (`rule_id`) REFERENCES `amasty_acart_rule` (`rule_id`) ON DELETE CASCADE,
  CONSTRAINT `FK_898E5863210B2932733BE8D92E7347DC` FOREIGN KEY (`customer_group_id`) REFERENCES `customer_group` (`customer_group_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb3 COMMENT='Amasty Acart Rule-Customer Relation Table';

--
-- Table structure for table `amasty_acart_rule_quote`
--

CREATE TABLE `amasty_acart_rule_quote` (
  `rule_quote_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Rule Quote Id',
  `quote_id` int unsigned DEFAULT NULL COMMENT 'Quote ID',
  `rule_id` int unsigned DEFAULT NULL COMMENT 'Rule ID',
  `status` varchar(32) DEFAULT NULL COMMENT 'Status',
  `store_id` smallint unsigned DEFAULT '0' COMMENT 'Store Id',
  `customer_id` int unsigned DEFAULT NULL COMMENT 'Customer Id',
  `customer_email` varchar(255) DEFAULT NULL COMMENT 'Customer Email',
  `customer_firstname` varchar(255) DEFAULT NULL COMMENT 'Customer Firstname',
  `customer_lastname` varchar(255) DEFAULT NULL COMMENT 'Customer Lastname',
  `test_mode` smallint NOT NULL DEFAULT '0' COMMENT 'Test Mode',
  `created_at` timestamp NULL DEFAULT NULL COMMENT 'Creation Date',
  `abandoned_status` varchar(25) NOT NULL DEFAULT 'notrestored' COMMENT 'Abandoned Cart Status',
  `customer_phone` varchar(50) DEFAULT NULL COMMENT 'Phone Number',
  PRIMARY KEY (`rule_quote_id`),
  KEY `AMASTY_ACART_RULE_QUOTE_RULE_ID_AMASTY_ACART_RULE_RULE_ID` (`rule_id`),
  KEY `AMASTY_ACART_RULE_QUOTE_QUOTE_ID_QUOTE_ENTITY_ID` (`quote_id`),
  KEY `AMASTY_ACART_RULE_QUOTE_STORE_ID_STORE_STORE_ID` (`store_id`),
  KEY `AMASTY_ACART_RULE_QUOTE_STATUS` (`status`),
  KEY `AMASTY_ACART_RULE_QUOTE_CUSTOMER_EMAIL` (`customer_email`),
  CONSTRAINT `AMASTY_ACART_RULE_QUOTE_QUOTE_ID_QUOTE_ENTITY_ID` FOREIGN KEY (`quote_id`) REFERENCES `quote` (`entity_id`) ON DELETE SET NULL,
  CONSTRAINT `AMASTY_ACART_RULE_QUOTE_RULE_ID_AMASTY_ACART_RULE_RULE_ID` FOREIGN KEY (`rule_id`) REFERENCES `amasty_acart_rule` (`rule_id`) ON DELETE SET NULL,
  CONSTRAINT `AMASTY_ACART_RULE_QUOTE_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=3532 DEFAULT CHARSET=utf8mb3 COMMENT='amasty_acart_rule_quote';

--
-- Table structure for table `amasty_acart_rule_store`
--

CREATE TABLE `amasty_acart_rule_store` (
  `rule_store_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Rule-Store Relation Id',
  `rule_id` int unsigned NOT NULL COMMENT 'Rule Id',
  `store_id` smallint unsigned NOT NULL COMMENT 'Store Id',
  PRIMARY KEY (`rule_store_id`),
  KEY `AMASTY_ACART_RULE_STORE_RULE_ID_AMASTY_ACART_RULE_RULE_ID` (`rule_id`),
  KEY `AMASTY_ACART_RULE_STORE_STORE_ID_STORE_STORE_ID` (`store_id`),
  CONSTRAINT `AMASTY_ACART_RULE_STORE_RULE_ID_AMASTY_ACART_RULE_RULE_ID` FOREIGN KEY (`rule_id`) REFERENCES `amasty_acart_rule` (`rule_id`) ON DELETE CASCADE,
  CONSTRAINT `AMASTY_ACART_RULE_STORE_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COMMENT='Amasty Acart Rule-Store Relation Table';

--
-- Table structure for table `amasty_acart_schedule`
--

CREATE TABLE `amasty_acart_schedule` (
  `schedule_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Schedule Id',
  `rule_id` int unsigned NOT NULL COMMENT 'Rule ID',
  `template_id` int unsigned DEFAULT NULL COMMENT 'Template ID',
  `days` smallint unsigned DEFAULT NULL COMMENT 'Days',
  `hours` smallint unsigned DEFAULT NULL COMMENT 'Hours',
  `minutes` smallint unsigned DEFAULT NULL COMMENT 'Minutes',
  `simple_action` varchar(32) DEFAULT NULL COMMENT 'Simple Action',
  `discount_amount` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Discount Amount',
  `expired_in_days` smallint unsigned DEFAULT NULL COMMENT 'Expired In Days',
  `discount_qty` decimal(12,4) DEFAULT NULL COMMENT 'Discount Qty',
  `discount_step` int unsigned NOT NULL COMMENT 'Discount Step',
  `subtotal_is_greater_than` smallint unsigned DEFAULT NULL COMMENT 'Subtotal Is Greater Than',
  `use_shopping_cart_rule` tinyint(1) NOT NULL COMMENT 'Use Shopping Cart Rule',
  `sales_rule_id` int unsigned DEFAULT NULL COMMENT 'Sales Rule ID',
  `created_at` timestamp NULL DEFAULT NULL COMMENT 'Creation Date',
  `send_same_coupon` smallint NOT NULL DEFAULT '0' COMMENT 'Send Same Coupon',
  `use_campaign_utm` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'Use Schedule Google Analytics UTM Parameters',
  `utm_source` varchar(255) DEFAULT NULL COMMENT 'Utm Source',
  `utm_medium` varchar(255) DEFAULT NULL COMMENT 'Utm Medium',
  `utm_campaign` varchar(255) DEFAULT NULL COMMENT 'Utm Campaign',
  PRIMARY KEY (`schedule_id`),
  KEY `AMASTY_ACART_SCHEDULE_RULE_ID_AMASTY_ACART_RULE_RULE_ID` (`rule_id`),
  KEY `AMASTY_ACART_SCHEDULE_TEMPLATE_ID_EMAIL_TEMPLATE_TEMPLATE_ID` (`template_id`),
  KEY `AMASTY_ACART_SCHEDULE_SALES_RULE_ID_SALESRULE_RULE_ID` (`sales_rule_id`),
  CONSTRAINT `AMASTY_ACART_SCHEDULE_RULE_ID_AMASTY_ACART_RULE_RULE_ID` FOREIGN KEY (`rule_id`) REFERENCES `amasty_acart_rule` (`rule_id`) ON DELETE CASCADE,
  CONSTRAINT `AMASTY_ACART_SCHEDULE_SALES_RULE_ID_SALESRULE_RULE_ID` FOREIGN KEY (`sales_rule_id`) REFERENCES `salesrule` (`rule_id`) ON DELETE SET NULL,
  CONSTRAINT `AMASTY_ACART_SCHEDULE_TEMPLATE_ID_EMAIL_TEMPLATE_TEMPLATE_ID` FOREIGN KEY (`template_id`) REFERENCES `email_template` (`template_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb3 COMMENT='amasty_acart_schedule';

--
-- Table structure for table `amasty_ampromo_rule`
--

CREATE TABLE `amasty_ampromo_rule` (
  `entity_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `salesrule_id` int unsigned NOT NULL COMMENT 'Salesrule Entity Id',
  `sku` text NOT NULL COMMENT 'Promo Products SKUs',
  `type` smallint NOT NULL COMMENT 'Promo Rule Type',
  `top_banner_show_gift_images` tinyint(1) NOT NULL COMMENT 'Show Gift Images',
  `after_product_banner_show_gift_images` tinyint(1) NOT NULL COMMENT 'Show Gift Images',
  `items_discount` varchar(255) DEFAULT '' COMMENT 'Promo Items Discount',
  `minimal_items_price` float DEFAULT NULL COMMENT 'Minimal Price',
  `apply_tax` tinyint(1) NOT NULL COMMENT 'Apply tax on original price of promo items added for free',
  `apply_shipping` tinyint(1) NOT NULL COMMENT 'Apply shipping on promo items added for free',
  PRIMARY KEY (`entity_id`),
  KEY `AMASTY_AMPROMO_RULE_SALESRULE_ID` (`salesrule_id`),
  CONSTRAINT `AMASTY_AMPROMO_RULE_SALESRULE_ID_SALESRULE_RULE_ID` FOREIGN KEY (`salesrule_id`) REFERENCES `salesrule` (`rule_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=127 DEFAULT CHARSET=utf8mb3 COMMENT='Amasty Autoadd Rules Table';

--
-- Table structure for table `amasty_audit_active_sessions`
--

CREATE TABLE `amasty_audit_active_sessions` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Active Session ID',
  `session_id` text NOT NULL COMMENT 'Active Session Session ID',
  `username` text COMMENT 'Active Session Username',
  `full_name` text COMMENT 'Active Session User Full Name',
  `ip` text COMMENT 'Active Session User IP',
  `session_start` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Active Session Start Time',
  `recent_activity` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Active Session Recent Activity Time',
  `location` text COMMENT 'Active Session Location',
  `country_id` text COMMENT 'Active Session Country ID',
  `admin_session_info_id` int unsigned DEFAULT NULL COMMENT 'Admin Session Info Id',
  `user_id` int unsigned DEFAULT NULL COMMENT 'Admin User Id',
  PRIMARY KEY (`id`),
  KEY `AMASTY_AUDIT_ACTIVE_SESSIONS_USER_ID` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1931 DEFAULT CHARSET=utf8mb3 COMMENT='Amasty Admin Actions Log Active Sessions Table';

--
-- Table structure for table `amasty_audit_log_details`
--

CREATE TABLE `amasty_audit_log_details` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Log Detail ID',
  `log_id` int unsigned NOT NULL COMMENT 'Log Entry ID',
  `name` text COMMENT 'Name',
  `old_value` text COMMENT 'Old Value',
  `new_value` text COMMENT 'New Value',
  `model` text COMMENT 'Model',
  PRIMARY KEY (`id`),
  KEY `AMASTY_AUDIT_LOG_DETAILS_LOG_ID` (`log_id`),
  CONSTRAINT `AMASTY_AUDIT_LOG_DETAILS_LOG_ID_AMASTY_AUDIT_LOG_ENTRY_ID` FOREIGN KEY (`log_id`) REFERENCES `amasty_audit_log_entry` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=195406 DEFAULT CHARSET=utf8mb3 COMMENT='Amasty Admin Actions Log Log Detail Table';

--
-- Table structure for table `amasty_audit_log_entry`
--

CREATE TABLE `amasty_audit_log_entry` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Log Entry ID',
  `date` datetime DEFAULT NULL COMMENT 'Log Entry Date',
  `username` varchar(40) DEFAULT NULL COMMENT 'Log Entry Username',
  `type` varchar(70) DEFAULT NULL COMMENT 'Log Entry Type',
  `category` varchar(255) DEFAULT NULL COMMENT 'Log Entry Category',
  `category_name` varchar(255) DEFAULT NULL COMMENT 'Log Entry Category Name',
  `parameter_name` varchar(255) DEFAULT NULL COMMENT 'Log Entry Parameter Name',
  `element_id` int unsigned NOT NULL COMMENT 'Log Entry Element ID',
  `view_element_id` int unsigned DEFAULT NULL COMMENT 'Log Entry View Element ID',
  `item` text COMMENT 'Log Entry Item',
  `ip` varchar(30) DEFAULT NULL COMMENT 'Log Entry Item',
  `store_id` int unsigned DEFAULT NULL COMMENT 'Log Entry Store ID',
  `additional_data` blob COMMENT 'Additional serialized data',
  PRIMARY KEY (`id`),
  KEY `AMASTY_AUDIT_LOG_ENTRY_USERNAME` (`username`),
  KEY `AMASTY_AUDIT_LOG_ENTRY_CATEGORY` (`category`),
  KEY `AMASTY_AUDIT_LOG_ENTRY_ELEMENT_ID` (`element_id`)
) ENGINE=InnoDB AUTO_INCREMENT=37209 DEFAULT CHARSET=utf8mb3 COMMENT='Amasty Admin Actions Log Entry Table';

--
-- Table structure for table `amasty_audit_login_attempts`
--

CREATE TABLE `amasty_audit_login_attempts` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Login Attempt ID',
  `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Login Attempt Date Time',
  `username` text COMMENT 'Login Attempt Username',
  `full_name` text COMMENT 'Login Attempt User Full Name',
  `ip` text COMMENT 'Login Attempt User IP',
  `status` smallint DEFAULT NULL COMMENT 'Login Attempt Status',
  `location` text COMMENT 'Login Attempt Location',
  `country_id` text COMMENT 'Login Attempt Country ID',
  `user_agent` text COMMENT 'Login Attempt User Agent',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2618 DEFAULT CHARSET=utf8mb3 COMMENT='Amasty Admin Actions Log Login Attempts Table';

--
-- Table structure for table `amasty_audit_visit_details`
--

CREATE TABLE `amasty_audit_visit_details` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Visit History Detail ID',
  `visit_id` int unsigned NOT NULL COMMENT 'Visit History Entry ID',
  `page_name` text COMMENT 'Page Name',
  `page_url` text COMMENT 'Page URL',
  `stay_duration` int DEFAULT NULL COMMENT 'Stay Duration',
  `session_id` text COMMENT 'Session ID',
  PRIMARY KEY (`id`),
  KEY `AMASTY_AUDIT_VISIT_DETAILS_VISIT_ID` (`visit_id`),
  CONSTRAINT `AMASTY_AUDIT_VISIT_DETAILS_VISIT_ID_AMASTY_AUDIT_VISIT_ENTRY_ID` FOREIGN KEY (`visit_id`) REFERENCES `amasty_audit_visit_entry` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=75036 DEFAULT CHARSET=utf8mb3 COMMENT='Amasty Admin Actions Log Visit History Detail Table';

--
-- Table structure for table `amasty_audit_visit_entry`
--

CREATE TABLE `amasty_audit_visit_entry` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Visit History Entry ID',
  `username` text COMMENT 'Visit History Entry Username',
  `full_name` text COMMENT 'Visit History Entry Full Name',
  `session_start` datetime DEFAULT NULL COMMENT 'Visit History Entry Session Start',
  `session_end` datetime DEFAULT NULL COMMENT 'Visit History Entry Session End',
  `ip` text COMMENT 'Visit History Entry IP',
  `location` text COMMENT 'Visit History Entry Location',
  `session_id` text COMMENT 'Visit History Entry Session Id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1936 DEFAULT CHARSET=utf8mb3 COMMENT='Amasty Admin Actions Visit History Entry Table';

--
-- Table structure for table `amasty_banners_lite_banner_data`
--

CREATE TABLE `amasty_banners_lite_banner_data` (
  `entity_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `salesrule_id` int unsigned NOT NULL COMMENT 'Salesrule Entity Id',
  `banner_type` int NOT NULL DEFAULT '0' COMMENT 'Banner Type',
  `banner_image` text COMMENT 'Banner Image',
  `banner_alt` varchar(255) DEFAULT NULL COMMENT 'Banner Alt',
  `banner_hover_text` varchar(255) DEFAULT NULL COMMENT 'Banner Hover Text',
  `banner_link` varchar(255) DEFAULT NULL COMMENT 'Banner Link',
  PRIMARY KEY (`entity_id`),
  KEY `AMASTY_BANNERS_LITE_BANNER_DATA_SALESRULE_ID` (`salesrule_id`),
  CONSTRAINT `AMASTY_BANNERS_LITE_BANNER_DATA_SALESRULE_ID_SALESRULE_RULE_ID` FOREIGN KEY (`salesrule_id`) REFERENCES `salesrule` (`rule_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Amasty Promo Banners Lite Banner Data Table';

--
-- Table structure for table `amasty_banners_lite_rule`
--

CREATE TABLE `amasty_banners_lite_rule` (
  `entity_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `salesrule_id` int unsigned NOT NULL COMMENT 'Salesrule Entity Id',
  `banner_product_sku` text COMMENT 'Banner Type',
  `banner_product_categories` text COMMENT 'Banner Image',
  `show_banner_for` int DEFAULT NULL COMMENT 'Banner Alt',
  PRIMARY KEY (`entity_id`),
  KEY `AMASTY_BANNERS_LITE_RULE_SALESRULE_ID` (`salesrule_id`),
  CONSTRAINT `AMASTY_BANNERS_LITE_RULE_SALESRULE_ID_SALESRULE_RULE_ID` FOREIGN KEY (`salesrule_id`) REFERENCES `salesrule` (`rule_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=127 DEFAULT CHARSET=utf8mb3 COMMENT='Amasty Promo Banners Lite Rule';

--
-- Table structure for table `amasty_conditions_quote`
--

CREATE TABLE `amasty_conditions_quote` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `quote_id` int unsigned DEFAULT NULL COMMENT 'Quote ID',
  `payment_code` text NOT NULL COMMENT 'Payment Code For Quote',
  PRIMARY KEY (`id`),
  KEY `AMASTY_CONDITIONS_QUOTE_QUOTE_ID` (`quote_id`)
) ENGINE=InnoDB AUTO_INCREMENT=16805 DEFAULT CHARSET=utf8mb3 COMMENT='Amasty Conditions Quote Information';

--
-- Table structure for table `amasty_coupons_same_rule`
--

CREATE TABLE `amasty_coupons_same_rule` (
  `entity_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `rule_id` int unsigned NOT NULL COMMENT 'Sales Rule link ID',
  `allow_coupons_same_rule` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Is Allowed to Apply Multi Coupons',
  `use_config_value` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'Is Use Config Value of Is Allowed',
  PRIMARY KEY (`entity_id`),
  UNIQUE KEY `AMASTY_COUPONS_SAME_RULE_RULE_ID` (`rule_id`)
) ENGINE=InnoDB AUTO_INCREMENT=127 DEFAULT CHARSET=utf8mb3 COMMENT='Additional data table for Sales Rule with coupon configuration';

--
-- Table structure for table `amasty_elastic_popup_data_cl`
--

CREATE TABLE `amasty_elastic_popup_data_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=utf8mb3 COMMENT='amasty_elastic_popup_data_cl';

--
-- Table structure for table `amasty_elastic_relevance_rule`
--

CREATE TABLE `amasty_elastic_relevance_rule` (
  `rule_id` smallint unsigned NOT NULL AUTO_INCREMENT COMMENT 'Relevance Rule Id',
  `is_enabled` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'Is Rule Enabled',
  `title` varchar(255) NOT NULL COMMENT 'Rule Title',
  `website_id` smallint unsigned NOT NULL COMMENT 'Website Id',
  `from_date` date DEFAULT NULL COMMENT 'Is Enabled From Date',
  `to_date` date DEFAULT NULL COMMENT 'Is Enabled to Date',
  `multiplier` smallint NOT NULL DEFAULT '1' COMMENT 'Relevance Multiplier',
  `conditions_serialized` text COMMENT 'Relevance Rule Conditions',
  PRIMARY KEY (`rule_id`),
  KEY `AMASTY_ELASTIC_RELEVANCE_RULE_IS_ENABLED` (`is_enabled`),
  KEY `AMASTY_ELASTIC_RELEVANCE_RULE_WEBSITE_ID` (`website_id`),
  CONSTRAINT `AMASTY_ELASTIC_RELEVANCE_RULE_WS_ID_STORE_WS_WS_ID` FOREIGN KEY (`website_id`) REFERENCES `store_website` (`website_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Relevance Rules';
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_amasty_elastic_relevance_rule_after_insert` AFTER INSERT ON `amasty_elastic_relevance_rule` FOR EACH ROW BEGIN
INSERT IGNORE INTO `amasty_elastic_relevance_rule_rule_cl` (`entity_id`) VALUES (NEW.`rule_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_amasty_elastic_relevance_rule_after_update` AFTER UPDATE ON `amasty_elastic_relevance_rule` FOR EACH ROW BEGIN
IF (NOT(NEW.`rule_id` <=> OLD.`rule_id`) OR NOT(NEW.`is_enabled` <=> OLD.`is_enabled`) OR NOT(NEW.`title` <=> OLD.`title`) OR NOT(NEW.`website_id` <=> OLD.`website_id`) OR NOT(NEW.`from_date` <=> OLD.`from_date`) OR NOT(NEW.`to_date` <=> OLD.`to_date`) OR NOT(NEW.`multiplier` <=> OLD.`multiplier`) OR NOT(NEW.`conditions_serialized` <=> OLD.`conditions_serialized`)) THEN INSERT IGNORE INTO `amasty_elastic_relevance_rule_rule_cl` (`entity_id`) VALUES (NEW.`rule_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_amasty_elastic_relevance_rule_after_delete` AFTER DELETE ON `amasty_elastic_relevance_rule` FOR EACH ROW BEGIN
INSERT IGNORE INTO `amasty_elastic_relevance_rule_rule_cl` (`entity_id`) VALUES (OLD.`rule_id`);
END */;;
DELIMITER ;

--
-- Table structure for table `amasty_elastic_relevance_rule_index_tmp`
--

CREATE TABLE `amasty_elastic_relevance_rule_index_tmp` (
  `rule_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Rule Id',
  `product_id` int unsigned NOT NULL COMMENT 'Product Id',
  `website_id` smallint unsigned NOT NULL COMMENT 'Website Id',
  `multiplier` smallint NOT NULL COMMENT 'Relevance Multiplier',
  PRIMARY KEY (`rule_id`,`product_id`,`website_id`),
  KEY `AMASTY_ELASTIC_RELEVANCE_RULE_INDEX_TMP_PRODUCT_ID_WEBSITE_ID` (`product_id`,`website_id`),
  KEY `AMASTY_ELASTIC_RELEVANCE_RULE_INDEX_TMP_WEBSITE_ID` (`website_id`),
  CONSTRAINT `AMASTY_ELASTIC_RELEVANCE_RULE_IDX_TMP_WS_ID_STORE_WS_WS_ID` FOREIGN KEY (`website_id`) REFERENCES `store_website` (`website_id`) ON DELETE CASCADE,
  CONSTRAINT `FK_C930FE7CFA3F67497AA363997234EB7E` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Relevance Rule Product';

--
-- Table structure for table `amasty_elastic_relevance_rule_product_cl`
--

CREATE TABLE `amasty_elastic_relevance_rule_product_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=135936 DEFAULT CHARSET=utf8mb3 COMMENT='amasty_elastic_relevance_rule_product_cl';

--
-- Table structure for table `amasty_elastic_relevance_rule_rule_cl`
--

CREATE TABLE `amasty_elastic_relevance_rule_rule_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=utf8mb3 COMMENT='amasty_elastic_relevance_rule_rule_cl';

--
-- Table structure for table `amasty_elastic_stop_word`
--

CREATE TABLE `amasty_elastic_stop_word` (
  `stop_word_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Stop Word Id',
  `term` varchar(255) NOT NULL COMMENT 'Stop Word',
  `store_id` int NOT NULL COMMENT 'Store Id',
  PRIMARY KEY (`stop_word_id`),
  UNIQUE KEY `AMASTY_ELASTIC_STOP_WORD_TERM_STORE_ID` (`term`,`store_id`),
  KEY `AMASTY_ELASTIC_STOP_WORD_TERM` (`term`)
) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8mb3 COMMENT='Stop Words Data';

--
-- Table structure for table `amasty_elastic_synonym`
--

CREATE TABLE `amasty_elastic_synonym` (
  `synonym_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Synonym Id',
  `store_id` int NOT NULL COMMENT 'Store Id',
  `term` varchar(255) NOT NULL COMMENT 'Term',
  PRIMARY KEY (`synonym_id`),
  UNIQUE KEY `AMASTY_ELASTIC_SYNONYM_TERM_STORE_ID` (`term`,`store_id`),
  KEY `AMASTY_ELASTIC_SYNONYM_TERM` (`term`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb3 COMMENT='Terms and Synonyms Data';

--
-- Table structure for table `amasty_feed_category`
--

CREATE TABLE `amasty_feed_category` (
  `feed_category_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Feed Category Id',
  `code` varchar(255) DEFAULT NULL COMMENT 'Code',
  `name` varchar(255) DEFAULT NULL COMMENT 'Name',
  `use_taxonomy` smallint NOT NULL COMMENT 'Flag to use taxonomy',
  `taxonomy_source` varchar(25) NOT NULL COMMENT 'Source for taxonomy ',
  PRIMARY KEY (`feed_category_id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb3 COMMENT='amasty_feed_category';

--
-- Table structure for table `amasty_feed_category_mapping`
--

CREATE TABLE `amasty_feed_category_mapping` (
  `entity_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Rule Id',
  `feed_category_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Feed Category ID',
  `category_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Category ID',
  `variable` varchar(255) DEFAULT NULL COMMENT 'Variable',
  `skip` tinyint(1) NOT NULL COMMENT 'Skip this category in feed',
  PRIMARY KEY (`entity_id`),
  KEY `AMASTY_FEED_CATEGORY_MAPPING_FEED_CATEGORY_ID` (`feed_category_id`),
  KEY `AMASTY_FEED_CATEGORY_MAPPING_CATEGORY_ID` (`category_id`),
  CONSTRAINT `FK_357DB4125516E63AE530B276D68369F7` FOREIGN KEY (`feed_category_id`) REFERENCES `amasty_feed_category` (`feed_category_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=1093 DEFAULT CHARSET=utf8mb3 COMMENT='amasty_feed_category_mapping';

--
-- Table structure for table `amasty_feed_entity`
--

CREATE TABLE `amasty_feed_entity` (
  `entity_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Rule Id',
  `name` varchar(255) DEFAULT NULL COMMENT 'Name',
  `filename` varchar(255) DEFAULT NULL COMMENT 'File Name',
  `feed_type` varchar(255) DEFAULT NULL COMMENT 'Feed Type',
  `is_active` smallint NOT NULL DEFAULT '0' COMMENT 'Is Active',
  `store_id` smallint unsigned DEFAULT '0' COMMENT 'Store ID',
  `execute_mode` varchar(255) NOT NULL DEFAULT 'manual' COMMENT 'Execute Mode',
  `csv_column_name` smallint NOT NULL DEFAULT '1' COMMENT 'Csv Column Name',
  `csv_header` text COMMENT 'Csv Header',
  `csv_enclosure` varchar(255) DEFAULT NULL COMMENT 'Csv Enclosure',
  `csv_delimiter` varchar(255) DEFAULT NULL COMMENT 'Csv Delimiter',
  `format_price_currency` varchar(255) DEFAULT NULL COMMENT 'Format Price Currency',
  `csv_field` mediumtext COMMENT 'Csv Field',
  `xml_header` mediumtext COMMENT 'Xml Header',
  `xml_item` varchar(255) DEFAULT NULL COMMENT 'Xml Item',
  `xml_content` mediumtext COMMENT 'Xml Content',
  `xml_footer` mediumtext COMMENT 'Xml Footer',
  `format_price_currency_show` smallint NOT NULL DEFAULT '1' COMMENT 'Format Price Currency Show',
  `format_price_decimals` varchar(255) NOT NULL DEFAULT 'two' COMMENT 'Format Price Decimals',
  `format_price_decimal_point` varchar(255) NOT NULL DEFAULT 'dot' COMMENT 'Format Price Decimal Point',
  `format_price_thousands_separator` varchar(255) NOT NULL DEFAULT 'comma' COMMENT 'Format Price Thousands Separator',
  `format_date` varchar(255) DEFAULT NULL COMMENT 'Format Date',
  `conditions_serialized` mediumtext COMMENT 'Conditions Serialized',
  `generated_at` timestamp NULL DEFAULT NULL COMMENT 'Generated At',
  `delivery_enabled` smallint NOT NULL DEFAULT '0' COMMENT 'Delivery Enabled',
  `delivery_host` varchar(255) DEFAULT NULL COMMENT 'Delivery Host',
  `delivery_type` varchar(255) DEFAULT NULL COMMENT 'Delivery Type',
  `delivery_user` varchar(255) DEFAULT NULL COMMENT 'Delivery User',
  `delivery_password` varchar(255) DEFAULT NULL COMMENT 'Delivery Password',
  `delivery_path` varchar(255) DEFAULT NULL COMMENT 'Delivery Path',
  `delivery_passive_mode` smallint NOT NULL DEFAULT '0' COMMENT 'Delivery Passive Mode',
  `utm_source` varchar(255) DEFAULT NULL COMMENT 'Utm Source',
  `utm_medium` varchar(255) DEFAULT NULL COMMENT 'Utm Medium',
  `utm_term` varchar(255) DEFAULT NULL COMMENT 'Utm Term',
  `utm_content` varchar(255) DEFAULT NULL COMMENT 'Utm Content',
  `utm_campaign` varchar(255) DEFAULT NULL COMMENT 'Utm Campaign',
  `is_template` smallint NOT NULL DEFAULT '0' COMMENT 'Is Template',
  `compress` varchar(255) NOT NULL DEFAULT '' COMMENT 'Compress',
  `exclude_disabled` tinyint(1) NOT NULL COMMENT 'Exclude Disabled Products',
  `exclude_out_of_stock` tinyint(1) NOT NULL COMMENT 'Exclude Out of Stock Products',
  `exclude_not_visible` tinyint(1) NOT NULL COMMENT 'Exclude Not Visible Products',
  `products_amount` int NOT NULL COMMENT 'Number of products',
  `generation_type` varchar(255) NOT NULL COMMENT 'Used generation type',
  `status` smallint NOT NULL COMMENT 'Last feed generation status',
  PRIMARY KEY (`entity_id`),
  KEY `AMASTY_FEED_ENTITY_STORE_ID` (`store_id`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8mb3 COMMENT='amasty_feed_entity';
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_amasty_feed_entity_after_insert` AFTER INSERT ON `amasty_feed_entity` FOR EACH ROW BEGIN
INSERT IGNORE INTO `amasty_feed_entity_cl` (`entity_id`) VALUES (NEW.`entity_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_amasty_feed_entity_after_update` AFTER UPDATE ON `amasty_feed_entity` FOR EACH ROW BEGIN
IF (NOT(NEW.`entity_id` <=> OLD.`entity_id`) OR NOT(NEW.`name` <=> OLD.`name`) OR NOT(NEW.`filename` <=> OLD.`filename`) OR NOT(NEW.`feed_type` <=> OLD.`feed_type`) OR NOT(NEW.`is_active` <=> OLD.`is_active`) OR NOT(NEW.`store_id` <=> OLD.`store_id`) OR NOT(NEW.`execute_mode` <=> OLD.`execute_mode`) OR NOT(NEW.`csv_column_name` <=> OLD.`csv_column_name`) OR NOT(NEW.`csv_header` <=> OLD.`csv_header`) OR NOT(NEW.`csv_enclosure` <=> OLD.`csv_enclosure`) OR NOT(NEW.`csv_delimiter` <=> OLD.`csv_delimiter`) OR NOT(NEW.`format_price_currency` <=> OLD.`format_price_currency`) OR NOT(NEW.`csv_field` <=> OLD.`csv_field`) OR NOT(NEW.`xml_header` <=> OLD.`xml_header`) OR NOT(NEW.`xml_item` <=> OLD.`xml_item`) OR NOT(NEW.`xml_content` <=> OLD.`xml_content`) OR NOT(NEW.`xml_footer` <=> OLD.`xml_footer`) OR NOT(NEW.`format_price_currency_show` <=> OLD.`format_price_currency_show`) OR NOT(NEW.`format_price_decimals` <=> OLD.`format_price_decimals`) OR NOT(NEW.`format_price_decimal_point` <=> OLD.`format_price_decimal_point`) OR NOT(NEW.`format_price_thousands_separator` <=> OLD.`format_price_thousands_separator`) OR NOT(NEW.`format_date` <=> OLD.`format_date`) OR NOT(NEW.`conditions_serialized` <=> OLD.`conditions_serialized`) OR NOT(NEW.`generated_at` <=> OLD.`generated_at`) OR NOT(NEW.`delivery_enabled` <=> OLD.`delivery_enabled`) OR NOT(NEW.`delivery_host` <=> OLD.`delivery_host`) OR NOT(NEW.`delivery_type` <=> OLD.`delivery_type`) OR NOT(NEW.`delivery_user` <=> OLD.`delivery_user`) OR NOT(NEW.`delivery_password` <=> OLD.`delivery_password`) OR NOT(NEW.`delivery_path` <=> OLD.`delivery_path`) OR NOT(NEW.`delivery_passive_mode` <=> OLD.`delivery_passive_mode`) OR NOT(NEW.`utm_source` <=> OLD.`utm_source`) OR NOT(NEW.`utm_medium` <=> OLD.`utm_medium`) OR NOT(NEW.`utm_term` <=> OLD.`utm_term`) OR NOT(NEW.`utm_content` <=> OLD.`utm_content`) OR NOT(NEW.`utm_campaign` <=> OLD.`utm_campaign`) OR NOT(NEW.`is_template` <=> OLD.`is_template`) OR NOT(NEW.`compress` <=> OLD.`compress`) OR NOT(NEW.`exclude_disabled` <=> OLD.`exclude_disabled`) OR NOT(NEW.`exclude_out_of_stock` <=> OLD.`exclude_out_of_stock`) OR NOT(NEW.`exclude_not_visible` <=> OLD.`exclude_not_visible`) OR NOT(NEW.`products_amount` <=> OLD.`products_amount`) OR NOT(NEW.`generation_type` <=> OLD.`generation_type`) OR NOT(NEW.`status` <=> OLD.`status`)) THEN INSERT IGNORE INTO `amasty_feed_entity_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_amasty_feed_entity_after_delete` AFTER DELETE ON `amasty_feed_entity` FOR EACH ROW BEGIN
INSERT IGNORE INTO `amasty_feed_entity_cl` (`entity_id`) VALUES (OLD.`entity_id`);
END */;;
DELIMITER ;

--
-- Table structure for table `amasty_feed_entity_cl`
--

CREATE TABLE `amasty_feed_entity_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=1843 DEFAULT CHARSET=utf8mb3 COMMENT='amasty_feed_entity_cl';

--
-- Table structure for table `amasty_feed_field`
--

CREATE TABLE `amasty_feed_field` (
  `feed_field_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Custom Field Id',
  `code` varchar(255) DEFAULT NULL COMMENT 'Code',
  `name` varchar(255) DEFAULT NULL COMMENT 'Name',
  PRIMARY KEY (`feed_field_id`),
  UNIQUE KEY `AMASTY_FEED_FIELD_CODE` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='amasty_feed_field';

--
-- Table structure for table `amasty_feed_field_conditions`
--

CREATE TABLE `amasty_feed_field_conditions` (
  `entity_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Condition Id',
  `feed_field_id` int NOT NULL COMMENT 'Custom Field Id',
  `conditions_serialized` mediumtext COMMENT 'Conditions',
  `result_serialized` mediumtext COMMENT 'Result',
  PRIMARY KEY (`entity_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='amasty_feed_field_conditions';

--
-- Table structure for table `amasty_feed_google_taxonomy`
--

CREATE TABLE `amasty_feed_google_taxonomy` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `category` text COMMENT 'Category',
  `language_code` text COMMENT 'Language Code',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=43417 DEFAULT CHARSET=utf8mb3 COMMENT='amasty_feed_google_taxonomy';

--
-- Table structure for table `amasty_feed_product_cl`
--

CREATE TABLE `amasty_feed_product_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=135936 DEFAULT CHARSET=utf8mb3 COMMENT='amasty_feed_product_cl';

--
-- Table structure for table `amasty_feed_schedule`
--

CREATE TABLE `amasty_feed_schedule` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `cron_time` int DEFAULT NULL COMMENT 'Cron Time Execution',
  `cron_day` int DEFAULT NULL COMMENT 'Cron Day Execution',
  `feed_id` int unsigned NOT NULL COMMENT 'Feed Id',
  PRIMARY KEY (`id`),
  KEY `AMASTY_FEED_SCHEDULE_FEED_ID_AMASTY_FEED_ENTITY_ENTITY_ID` (`feed_id`),
  CONSTRAINT `AMASTY_FEED_SCHEDULE_FEED_ID_AMASTY_FEED_ENTITY_ENTITY_ID` FOREIGN KEY (`feed_id`) REFERENCES `amasty_feed_entity` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=953 DEFAULT CHARSET=utf8mb3 COMMENT='Cron Schedule Execution';

--
-- Table structure for table `amasty_feed_valid_products`
--

CREATE TABLE `amasty_feed_valid_products` (
  `entity_id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity Id',
  `feed_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Feed ID',
  `valid_product_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Valid products for conditions',
  PRIMARY KEY (`entity_id`),
  KEY `AMASTY_FEED_VALID_PRODUCTS_FEED_ID_AMASTY_FEED_ENTITY_ENTITY_ID` (`feed_id`),
  KEY `AMASTY_FEED_VALID_PRODUCTS_VALID_PRODUCT_ID` (`valid_product_id`),
  CONSTRAINT `AMASTY_FEED_VALID_PRODUCTS_FEED_ID_AMASTY_FEED_ENTITY_ENTITY_ID` FOREIGN KEY (`feed_id`) REFERENCES `amasty_feed_entity` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=12330 DEFAULT CHARSET=utf8mb3 COMMENT='amasty_feed_valid_products';

--
-- Table structure for table `amasty_geoip_block`
--

CREATE TABLE `amasty_geoip_block` (
  `block_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Block Id',
  `start_ip_num` int unsigned NOT NULL COMMENT 'Start Ip Num',
  `end_ip_num` int unsigned NOT NULL COMMENT 'End Ip Num',
  `geoip_loc_id` int unsigned NOT NULL COMMENT 'Geoip Loc Id',
  `postal_code` text COMMENT 'Postal Code',
  `latitude` float(10,0) DEFAULT NULL COMMENT 'Latitude',
  `longitude` float(10,0) DEFAULT NULL COMMENT 'Longitude',
  PRIMARY KEY (`block_id`),
  KEY `AMASTY_GEOIP_BLOCK_GEOIP_LOC_ID` (`geoip_loc_id`),
  KEY `AMASTY_GEOIP_BLOCK_START_IP_NUM_END_IP_NUM` (`start_ip_num`,`end_ip_num`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Amasty Geoip Block Table';

--
-- Table structure for table `amasty_geoip_block_v6`
--

CREATE TABLE `amasty_geoip_block_v6` (
  `block_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Block Id',
  `start_ip_num` varchar(40) NOT NULL COMMENT 'Start Ip Num',
  `end_ip_num` varchar(40) NOT NULL COMMENT 'End Ip Num',
  `geoip_loc_id` int unsigned NOT NULL COMMENT 'Geoip Loc Id',
  `postal_code` text COMMENT 'Postal Code',
  `latitude` float(10,0) DEFAULT NULL COMMENT 'Latitude',
  `longitude` float(10,0) DEFAULT NULL COMMENT 'Longitude',
  PRIMARY KEY (`block_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Amasty Geoip Block Table IpV6';

--
-- Table structure for table `amasty_geoip_location`
--

CREATE TABLE `amasty_geoip_location` (
  `location_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Location Id',
  `geoip_loc_id` int unsigned NOT NULL COMMENT 'Geoip Loc Id',
  `country` text COMMENT 'Country',
  `city` text COMMENT 'City',
  `region` text COMMENT 'Region',
  PRIMARY KEY (`location_id`),
  KEY `AMASTY_GEOIP_LOCATION_GEOIP_LOC_ID` (`geoip_loc_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Amasty Geoip Location Table';

--
-- Table structure for table `amasty_method_label`
--

CREATE TABLE `amasty_method_label` (
  `entity_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `method_id` int unsigned NOT NULL COMMENT 'Method Id',
  `store_id` smallint unsigned NOT NULL COMMENT 'Store Entity Id',
  `label` varchar(255) DEFAULT NULL COMMENT 'Label',
  `comment` varchar(255) DEFAULT NULL COMMENT 'Comment',
  PRIMARY KEY (`entity_id`),
  KEY `AMASTY_METHOD_LABEL_STORE_ID_STORE_STORE_ID` (`store_id`),
  KEY `AMASTY_METHOD_LABEL_METHOD_ID_AMASTY_TABLE_METHOD_ID` (`method_id`),
  CONSTRAINT `AMASTY_METHOD_LABEL_METHOD_ID_AMASTY_TABLE_METHOD_ID` FOREIGN KEY (`method_id`) REFERENCES `amasty_table_method` (`id`) ON DELETE CASCADE,
  CONSTRAINT `AMASTY_METHOD_LABEL_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='amasty_method_label';

--
-- Table structure for table `amasty_recurring_payments_address`
--

CREATE TABLE `amasty_recurring_payments_address` (
  `entity_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `subscription_id` varchar(100) NOT NULL COMMENT 'Subscription Id',
  `country_id` varchar(30) DEFAULT NULL COMMENT 'Country Id',
  `region_id` int DEFAULT NULL COMMENT 'Region Id',
  `region_code` varchar(255) DEFAULT NULL COMMENT 'Region Code',
  `region` varchar(255) DEFAULT NULL COMMENT 'Region',
  `street` varchar(255) DEFAULT NULL COMMENT 'Street',
  `telephone` varchar(255) DEFAULT NULL COMMENT 'Telephone',
  `postcode` varchar(20) DEFAULT NULL COMMENT 'Post Code',
  `city` varchar(255) DEFAULT NULL COMMENT 'City',
  `firstname` varchar(255) DEFAULT NULL COMMENT 'First Name',
  `lastname` varchar(255) DEFAULT NULL COMMENT 'Last Name',
  `middlename` varchar(255) DEFAULT NULL COMMENT 'Middle Name',
  `prefix` varchar(40) DEFAULT NULL COMMENT 'Prefix',
  `suffix` varchar(40) DEFAULT NULL COMMENT 'Suffix',
  `same_as_billing` smallint NOT NULL DEFAULT '0' COMMENT 'Same As Billing',
  PRIMARY KEY (`entity_id`),
  KEY `AMASTY_RECURRING_PAYMENTS_ADDRESS_SUBSCRIPTION_ID` (`subscription_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COMMENT='Amasty Recurring Payments Address Table';

--
-- Table structure for table `amasty_recurring_payments_discount`
--

CREATE TABLE `amasty_recurring_payments_discount` (
  `entity_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `subscription_id` varchar(100) NOT NULL COMMENT 'Subscription Id',
  `discount_usage` int NOT NULL DEFAULT '0' COMMENT 'Count of Discount Usage',
  `available_discount_usage` int NOT NULL DEFAULT '0' COMMENT 'Count of Available Discount Usage',
  PRIMARY KEY (`entity_id`),
  KEY `AMASTY_RECURRING_PAYMENTS_DISCOUNT_SUBSCRIPTION_ID` (`subscription_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Amasty Recurring Payments Discount Table';

--
-- Table structure for table `amasty_recurring_payments_fee_quote`
--

CREATE TABLE `amasty_recurring_payments_fee_quote` (
  `entity_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `quote_id` int unsigned DEFAULT NULL COMMENT 'Quote Id',
  `amount` decimal(12,2) NOT NULL COMMENT 'Amount',
  `base_amount` decimal(12,2) NOT NULL COMMENT 'Base Amount',
  PRIMARY KEY (`entity_id`),
  KEY `AMASTY_RECURRING_PAYMENTS_FEE_QUOTE_QUOTE_ID_QUOTE_ENTITY_ID` (`quote_id`),
  CONSTRAINT `AMASTY_RECURRING_PAYMENTS_FEE_QUOTE_QUOTE_ID_QUOTE_ENTITY_ID` FOREIGN KEY (`quote_id`) REFERENCES `quote` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=428 DEFAULT CHARSET=utf8mb3 COMMENT='Amasty Recurring Payments Fee Table';

--
-- Table structure for table `amasty_recurring_payments_paypal_product`
--

CREATE TABLE `amasty_recurring_payments_paypal_product` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `product_id` int unsigned DEFAULT NULL COMMENT 'Product Id',
  `paypal_product_id` varchar(50) DEFAULT NULL COMMENT 'Paypal Product Id',
  PRIMARY KEY (`id`),
  KEY `AMASTY_RECURRING_PAYMENTS_PAYPAL_PRODUCT_PRODUCT_ID` (`product_id`),
  CONSTRAINT `AMASTY_RECURRING_PAYMENTS_PAYPAL_PRD_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Amasty Recurring Payments Paypal Products';

--
-- Table structure for table `amasty_recurring_payments_schedule`
--

CREATE TABLE `amasty_recurring_payments_schedule` (
  `schedule_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Schedule Id',
  `subscription_id` varchar(128) NOT NULL DEFAULT '' COMMENT 'Subscription',
  `job_code` varchar(128) NOT NULL DEFAULT '' COMMENT 'Job code',
  `status` varchar(7) NOT NULL DEFAULT 'pending' COMMENT 'Status',
  `message` text COMMENT 'Message',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Created At',
  `scheduled_at` timestamp NULL DEFAULT NULL COMMENT 'Scheduled At',
  `executed_at` timestamp NULL DEFAULT NULL COMMENT 'Executed At',
  `finished_at` timestamp NULL DEFAULT NULL COMMENT 'Finished At',
  PRIMARY KEY (`schedule_id`),
  KEY `AMASTY_RECURRING_PAYMENTS_SCHEDULE_SUBSCRIPTION_ID` (`subscription_id`),
  KEY `AMASTY_RECURRING_PAYMENTS_SCHEDULE_SCHEDULED_AT_STATUS` (`scheduled_at`,`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Amasty Subscription Schedule';

--
-- Table structure for table `amasty_recurring_payments_stripe_product`
--

CREATE TABLE `amasty_recurring_payments_stripe_product` (
  `entity_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `product_id` int unsigned DEFAULT NULL COMMENT 'Product Id',
  `stripe_product_id` varchar(255) DEFAULT NULL COMMENT 'Stripe Product Id',
  `stripe_account_id` varchar(255) DEFAULT NULL COMMENT 'Stripe Account Id of Business Owner',
  PRIMARY KEY (`entity_id`),
  KEY `AMASTY_RECURRING_PAYMENTS_STRIPE_PRD_PRD_ID_STRIPE_ACCOUNT_ID` (`product_id`,`stripe_account_id`),
  CONSTRAINT `AMASTY_RECURRING_PAYMENTS_STRIPE_PRD_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COMMENT='Amasty Recurring Payments Stripe Products';

--
-- Table structure for table `amasty_recurring_payments_subscription`
--

CREATE TABLE `amasty_recurring_payments_subscription` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Id',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Created_at',
  `subscription_id` varchar(128) NOT NULL COMMENT 'Subscription_id',
  `order_id` int unsigned NOT NULL COMMENT 'Order_id',
  `product_id` int unsigned NOT NULL COMMENT 'Product_id',
  `qty` int unsigned NOT NULL COMMENT 'Qty',
  `customer_id` int unsigned DEFAULT NULL COMMENT 'Customer_id',
  `payment_method` varchar(50) NOT NULL COMMENT 'Payment_method',
  `address_id` int unsigned DEFAULT NULL COMMENT 'Address_id',
  `product_options` text NOT NULL COMMENT 'Product_options',
  `store_id` smallint unsigned NOT NULL COMMENT 'Store_id',
  `shipping_method` varchar(128) NOT NULL COMMENT 'Shipping_method',
  `initial_fee` decimal(12,2) NOT NULL COMMENT 'Initial_fee',
  `base_discount_amount` decimal(12,2) NOT NULL COMMENT 'Base_discount_amount',
  `base_grand_total` decimal(12,2) NOT NULL COMMENT 'Base_grand_total',
  `free_shipping` tinyint(1) NOT NULL COMMENT 'Free_shipping',
  `trial_days` int unsigned NOT NULL COMMENT 'Trial_days',
  `delivery` varchar(128) NOT NULL COMMENT 'Delivery',
  `remaining_discount_cycles` int unsigned DEFAULT NULL COMMENT 'Remaining_discount_cycles',
  `status` varchar(255) DEFAULT NULL COMMENT 'Status',
  `frequency` int DEFAULT NULL COMMENT 'Frequency',
  `frequency_unit` varchar(255) DEFAULT NULL COMMENT 'Frequency Unit',
  `last_payment_date` timestamp NULL DEFAULT NULL COMMENT 'Last Payment Date',
  `start_date` timestamp NULL DEFAULT NULL COMMENT 'Subscription Start Date (Including Trial)',
  `end_date` timestamp NULL DEFAULT NULL COMMENT 'Subscription End Date',
  `count_discount_cycles` int NOT NULL DEFAULT '0' COMMENT 'Count discount cycles',
  `customer_timezone` varchar(255) DEFAULT NULL COMMENT 'Customer Timezone',
  `customer_email` varchar(255) NOT NULL DEFAULT '' COMMENT 'Customer Email',
  `base_grand_total_with_discount` decimal(12,4) NOT NULL COMMENT 'Discounted Base Grand Total',
  PRIMARY KEY (`id`),
  KEY `FK_41C16F6571DEB91DC9F7BD6837E621B9` (`product_id`),
  KEY `AMASTY_RECURRING_PAYMENTS_SUBSCRIPTION_STORE_ID_STORE_STORE_ID` (`store_id`),
  KEY `AMASTY_RECURRING_PAYMENTS_SUBSCRIPTION_CSTR_ID_CSTR_ENTT_ENTT_ID` (`customer_id`),
  KEY `FK_5B7E07B128DBA42A39C8B1FBB615E01F` (`address_id`),
  KEY `AMASTY_RECURRING_PAYMENTS_SUBSCRIPTION_SUBSCRIPTION_ID` (`subscription_id`),
  CONSTRAINT `AMASTY_RECURRING_PAYMENTS_SUBSCRIPTION_CSTR_ID_CSTR_ENTT_ENTT_ID` FOREIGN KEY (`customer_id`) REFERENCES `customer_entity` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `AMASTY_RECURRING_PAYMENTS_SUBSCRIPTION_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON DELETE CASCADE,
  CONSTRAINT `FK_41C16F6571DEB91DC9F7BD6837E621B9` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `FK_5B7E07B128DBA42A39C8B1FBB615E01F` FOREIGN KEY (`address_id`) REFERENCES `amasty_recurring_payments_address` (`entity_id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COMMENT='Amasty Recurring Payments Subscriptions Table';

--
-- Table structure for table `amasty_recurring_payments_subscription_plan`
--

CREATE TABLE `amasty_recurring_payments_subscription_plan` (
  `plan_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Subscription Plan Id',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Created At',
  `name` varchar(255) NOT NULL DEFAULT '' COMMENT 'Plan Name',
  `status` smallint unsigned NOT NULL COMMENT 'Status',
  `frequency` int unsigned NOT NULL COMMENT 'Frequency',
  `frequency_unit` varchar(128) NOT NULL DEFAULT '' COMMENT 'Frequency Unit',
  `enable_trial` tinyint(1) NOT NULL COMMENT 'Is Trial Enabled',
  `trial_days` int unsigned NOT NULL COMMENT 'Number of Trial Days',
  `enable_initial_fee` tinyint(1) NOT NULL COMMENT 'Is Initial Fee Enabled',
  `initial_fee_type` varchar(255) DEFAULT NULL COMMENT 'Type of Initial Fee',
  `initial_fee_amount` decimal(12,4) NOT NULL COMMENT 'Initial Fee Amount',
  `enable_discount` tinyint(1) NOT NULL COMMENT 'Is Discount Enabled',
  `discount_type` varchar(255) DEFAULT NULL COMMENT 'Type of Discount',
  `discount_amount` decimal(12,4) NOT NULL COMMENT 'Discount Amount',
  `enable_discount_limit` tinyint(1) NOT NULL COMMENT 'Is Discount Limit Enabled',
  `number_discounted_cycles` int unsigned NOT NULL COMMENT 'Number of Discount Cycles',
  PRIMARY KEY (`plan_id`),
  KEY `AMASTY_RECURRING_PAYMENTS_SUBSCRIPTION_PLAN_PLAN_ID` (`plan_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb3 COMMENT='Amasty Subscription Plan Table';

--
-- Table structure for table `amasty_recurring_payments_transaction_log`
--

CREATE TABLE `amasty_recurring_payments_transaction_log` (
  `entity_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `transaction_id` varchar(100) DEFAULT NULL COMMENT 'Transaction Id',
  `order_id` varchar(32) DEFAULT NULL COMMENT 'Order Id',
  `billing_amount` decimal(12,2) NOT NULL COMMENT 'Billing Amount',
  `billing_date` datetime NOT NULL COMMENT 'Billing Date',
  `status` int NOT NULL DEFAULT '0' COMMENT 'Status',
  `billing_currency_code` varchar(32) NOT NULL COMMENT 'Currency Code',
  `subscription_id` varchar(128) NOT NULL DEFAULT '' COMMENT 'Subscription Id',
  `new_order_id` varchar(255) NOT NULL DEFAULT '' COMMENT 'New Order Increment Id',
  PRIMARY KEY (`entity_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COMMENT='Amasty Recurring Payments Transaction Log Table';

--
-- Table structure for table `amasty_shipping_area`
--

CREATE TABLE `amasty_shipping_area` (
  `area_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `name` varchar(255) NOT NULL COMMENT 'Name',
  `description` varchar(255) DEFAULT NULL COMMENT 'Description',
  `is_enabled` tinyint(1) NOT NULL COMMENT 'Is_enabled',
  `country_condition` int NOT NULL DEFAULT '0' COMMENT 'Country_condition',
  `country_set` text COMMENT 'Country_set',
  `state_condition` int NOT NULL DEFAULT '0' COMMENT 'State_condition',
  `state_set` text COMMENT 'State_set',
  `city_condition` int NOT NULL DEFAULT '0' COMMENT 'City_condition',
  `city_set` text COMMENT 'City_set',
  `postcode_condition` int NOT NULL DEFAULT '0' COMMENT 'Postcode_condition',
  `postcode_set` text COMMENT 'Postcode_set',
  `address_condition` int NOT NULL DEFAULT '0' COMMENT 'Address_condition',
  `address_set` text COMMENT 'Address_set',
  `state_set_listing` text COMMENT 'State_set_listing',
  PRIMARY KEY (`area_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Shipping Areas by Amasty (Set of address conditions)';

--
-- Table structure for table `amasty_shiprestriction_attribute`
--

CREATE TABLE `amasty_shiprestriction_attribute` (
  `attr_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Attribute ID',
  `rule_id` int unsigned NOT NULL COMMENT 'Rule ID',
  `code` varchar(255) DEFAULT NULL COMMENT 'Code',
  PRIMARY KEY (`attr_id`),
  KEY `AMASTY_SHIPRESTRICTION_ATTRIBUTE_RULE_ID` (`rule_id`),
  CONSTRAINT `FK_AE0541C428579FC141904B5D985FC509` FOREIGN KEY (`rule_id`) REFERENCES `amasty_shiprestriction_rule` (`rule_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=127 DEFAULT CHARSET=utf8mb3 COMMENT='Amasty Shipping Restrictions Attribute Table';

--
-- Table structure for table `amasty_shiprestriction_rule`
--

CREATE TABLE `amasty_shiprestriction_rule` (
  `rule_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Rule ID',
  `is_active` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Is Active',
  `for_admin` smallint NOT NULL COMMENT 'Is Active In Admin Area',
  `out_of_stock` smallint NOT NULL COMMENT 'Apply the rule to',
  `all_stores` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'All Stores',
  `all_groups` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'All Groups',
  `name` varchar(255) NOT NULL COMMENT 'Restriction Name',
  `coupon` varchar(255) DEFAULT NULL COMMENT 'Coupon',
  `discount_id` varchar(255) NOT NULL COMMENT 'Discount ID',
  `days` varchar(255) DEFAULT '' COMMENT 'Days of the Week',
  `time_from` int unsigned NOT NULL DEFAULT '0' COMMENT 'Time From',
  `time_to` int unsigned NOT NULL DEFAULT '0' COMMENT 'Time To',
  `stores` varchar(255) NOT NULL DEFAULT '' COMMENT 'Apply In Stores',
  `cust_groups` varchar(255) NOT NULL DEFAULT '' COMMENT 'Apply For Customer Groups',
  `carriers` text COMMENT 'Carriers',
  `methods` text COMMENT 'Methods',
  `conditions_serialized` text COMMENT 'Conditions',
  `coupon_disable` varchar(255) DEFAULT NULL COMMENT 'Coupon Codes',
  `discount_id_disable` varchar(255) NOT NULL COMMENT 'Disable Discount ID',
  `show_restriction_message` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Show Restriction Message',
  `custom_restriction_message` varchar(500) DEFAULT NULL COMMENT 'Custom Restriction Message',
  `show_restriction_message_once` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Show Restriction Message Once',
  PRIMARY KEY (`rule_id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb3 COMMENT='Amasty Shipping Restrictions Rule Table';

--
-- Table structure for table `amasty_shiprules_attribute`
--

CREATE TABLE `amasty_shiprules_attribute` (
  `attr_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Attr Id',
  `rule_id` int unsigned NOT NULL COMMENT 'Rule Id',
  `code` varchar(255) DEFAULT NULL COMMENT 'Code',
  PRIMARY KEY (`attr_id`),
  KEY `AMASTY_SHIPRULES_ATTRIBUTE_RULE_ID` (`rule_id`),
  CONSTRAINT `AMASTY_SHIPRULES_ATTRIBUTE_RULE_ID_AMASTY_SHIPRULES_RULE_RULE_ID` FOREIGN KEY (`rule_id`) REFERENCES `amasty_shiprules_rule` (`rule_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=398 DEFAULT CHARSET=utf8mb3 COMMENT='amasty_shiprules_attribute';

--
-- Table structure for table `amasty_shiprules_rule`
--

CREATE TABLE `amasty_shiprules_rule` (
  `rule_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Rule Id',
  `is_active` tinyint(1) NOT NULL COMMENT 'Is Active',
  `calc` tinyint(1) NOT NULL COMMENT 'Calculation Type',
  `discount_id` text NOT NULL COMMENT 'Discount Id',
  `ignore_promo` tinyint(1) NOT NULL COMMENT 'Ignore Promo',
  `pos` int unsigned NOT NULL DEFAULT '0' COMMENT 'Pos',
  `price_from` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT 'Price From',
  `price_to` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT 'Price To',
  `weight_from` decimal(12,4) unsigned NOT NULL DEFAULT '0.0000' COMMENT 'Weight From',
  `weight_to` decimal(12,4) unsigned NOT NULL DEFAULT '0.0000' COMMENT 'Weight To',
  `qty_from` int unsigned NOT NULL DEFAULT '0' COMMENT 'Qty_from',
  `qty_to` int unsigned NOT NULL DEFAULT '0' COMMENT 'Qty_to',
  `rate_base` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT 'Rate Base',
  `rate_fixed` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT 'Rate Fixed',
  `weight_fixed` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT 'Weight Fixed',
  `rate_percent` decimal(12,2) unsigned NOT NULL DEFAULT '0.00',
  `rate_min` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT 'Rate Min',
  `rate_max` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT 'Rate Max',
  `ship_min` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT 'Ship Min',
  `ship_max` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT 'Ship Max',
  `handling` decimal(12,2) unsigned NOT NULL DEFAULT '0.00',
  `name` varchar(255) NOT NULL COMMENT 'Name',
  `days` varchar(255) NOT NULL DEFAULT '' COMMENT 'Days',
  `stores` varchar(255) NOT NULL DEFAULT '' COMMENT 'Stores',
  `cust_groups` varchar(255) NOT NULL DEFAULT '' COMMENT 'Customer Groups',
  `carriers` text COMMENT 'Carriers',
  `methods` text COMMENT 'Methods',
  `coupon` text COMMENT 'Coupon',
  `conditions_serialized` text COMMENT 'Conditions_serialized',
  `actions_serialized` text COMMENT 'Actions_serialized',
  `out_of_stock` smallint NOT NULL DEFAULT '0' COMMENT 'Apply to Backorders',
  `time_from` int DEFAULT NULL COMMENT 'Time From',
  `time_to` int DEFAULT NULL COMMENT 'Time To',
  `coupon_disable` text COMMENT 'Coupon Disable',
  `discount_id_disable` text COMMENT 'Disable Discount ID',
  `for_admin` smallint NOT NULL COMMENT 'For Admin Rule',
  `skip_subsequent` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Skip Subsequent',
  `carrier_title` varchar(255) NOT NULL COMMENT 'Carrier Title',
  `method_title` varchar(255) NOT NULL COMMENT 'Method Title',
  PRIMARY KEY (`rule_id`)
) ENGINE=InnoDB AUTO_INCREMENT=49 DEFAULT CHARSET=utf8mb3 COMMENT='amasty_shiprules_rule';

--
-- Table structure for table `amasty_stripe_customers`
--

CREATE TABLE `amasty_stripe_customers` (
  `entity_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Id',
  `customer_id` int unsigned NOT NULL COMMENT 'Magento customer id',
  `stripe_customer_id` varchar(255) DEFAULT NULL COMMENT 'Stripe customer id',
  `stripe_account_id` varchar(255) DEFAULT NULL COMMENT 'Stripe account id of business owner',
  PRIMARY KEY (`entity_id`,`customer_id`),
  KEY `AMASTY_STRIPE_CUSTOMERS_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID` (`customer_id`),
  CONSTRAINT `AMASTY_STRIPE_CUSTOMERS_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID` FOREIGN KEY (`customer_id`) REFERENCES `customer_entity` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb3 COMMENT='Amasty stripe customers';

--
-- Table structure for table `amasty_table_method`
--

CREATE TABLE `amasty_table_method` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Id',
  `is_active` tinyint(1) NOT NULL COMMENT 'Is Active',
  `name` varchar(255) DEFAULT NULL COMMENT 'Name',
  `comment` text COMMENT 'Comment',
  `stores` varchar(255) NOT NULL COMMENT 'Stores',
  `cust_groups` varchar(255) NOT NULL COMMENT 'Customer Groups',
  `select_rate` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Select Rate',
  `min_rate` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT 'Min Rate',
  `max_rate` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT 'Max Rate',
  `free_types` varchar(255) NOT NULL DEFAULT '' COMMENT 'Free Types',
  `comment_img` varchar(255) DEFAULT NULL COMMENT 'Comment Image',
  `weight_type` smallint NOT NULL DEFAULT '3' COMMENT 'Weight Type For Calculation',
  `sort_order` smallint unsigned NOT NULL COMMENT 'Sort Order',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='amasty_table_method';

--
-- Table structure for table `amasty_table_rate`
--

CREATE TABLE `amasty_table_rate` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Id',
  `method_id` int unsigned NOT NULL COMMENT 'Method ID',
  `country` varchar(4) NOT NULL COMMENT 'Country',
  `state` int unsigned NOT NULL DEFAULT '0' COMMENT 'State',
  `zip_from` varchar(10) NOT NULL COMMENT 'ZIP From',
  `zip_to` varchar(10) NOT NULL COMMENT 'ZIP To',
  `price_from` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT 'Price From',
  `price_to` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT 'Price to',
  `weight_from` decimal(12,4) unsigned NOT NULL DEFAULT '0.0000' COMMENT 'Weight From',
  `weight_to` decimal(12,4) unsigned NOT NULL DEFAULT '0.0000' COMMENT 'Weight to',
  `qty_from` decimal(12,2) unsigned NOT NULL DEFAULT '0.00',
  `qty_to` decimal(12,2) unsigned NOT NULL DEFAULT '0.00',
  `shipping_type` int unsigned NOT NULL DEFAULT '0' COMMENT 'Shipping Type',
  `cost_base` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT 'Cost Base',
  `cost_percent` decimal(5,2) unsigned NOT NULL DEFAULT '0.00' COMMENT 'Cost Percent',
  `cost_product` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT 'Cost Product',
  `cost_weight` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT 'Cost Weight',
  `start_weight` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT 'Cost Weight From',
  `time_delivery` varchar(255) DEFAULT NULL COMMENT 'Time Delivery',
  `num_zip_from` int unsigned DEFAULT NULL COMMENT 'Num Zip To',
  `num_zip_to` int unsigned DEFAULT NULL COMMENT 'Num Zip  To',
  `city` varchar(255) NOT NULL DEFAULT '' COMMENT 'City',
  `name_delivery` varchar(255) DEFAULT NULL COMMENT 'Name',
  `unit_weight_conversion` decimal(12,5) unsigned NOT NULL DEFAULT '1.00000' COMMENT 'Unit weight conversion rate',
  `weight_rounding` int unsigned NOT NULL DEFAULT '0' COMMENT 'Weight Rounding',
  PRIMARY KEY (`id`),
  KEY `AMASTY_TABLE_RATE_METHOD_ID` (`method_id`),
  KEY `AMASTY_TABLE_RATE_COUNTRY_STATE_CITY_SHIPPING_TYPE` (`country`,`state`,`city`,`shipping_type`),
  KEY `AMASTY_TABLE_RATE_PRICE_FROM_PRICE_TO` (`price_from`,`price_to`),
  KEY `AMASTY_TABLE_RATE_WEIGHT_FROM_WEIGHT_TO` (`weight_from`,`weight_to`),
  KEY `AMASTY_TABLE_RATE_QTY_FROM_QTY_TO` (`qty_from`,`qty_to`),
  KEY `AMASTY_TABLE_RATE_NUM_ZIP_FROM_NUM_ZIP_TO` (`num_zip_from`,`num_zip_to`),
  CONSTRAINT `AMASTY_TABLE_RATE_METHOD_ID_AMASTY_TABLE_METHOD_ID` FOREIGN KEY (`method_id`) REFERENCES `amasty_table_method` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='amasty_table_rate';

--
-- Table structure for table `amasty_table_rate_replica`
--

CREATE TABLE `amasty_table_rate_replica` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Id',
  `method_id` int unsigned NOT NULL COMMENT 'Method ID',
  `country` varchar(4) NOT NULL COMMENT 'Country',
  `state` int unsigned NOT NULL DEFAULT '0' COMMENT 'State',
  `zip_from` varchar(10) NOT NULL COMMENT 'ZIP From',
  `zip_to` varchar(10) NOT NULL COMMENT 'ZIP To',
  `price_from` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT 'Price From',
  `price_to` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT 'Price to',
  `weight_from` decimal(12,4) unsigned NOT NULL DEFAULT '0.0000' COMMENT 'Weight From',
  `weight_to` decimal(12,4) unsigned NOT NULL DEFAULT '0.0000' COMMENT 'Weight to',
  `qty_from` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT 'QTY From',
  `qty_to` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT 'QTY To',
  `shipping_type` int unsigned NOT NULL DEFAULT '0' COMMENT 'Shipping Type',
  `cost_base` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT 'Cost Base',
  `cost_percent` decimal(5,2) unsigned NOT NULL DEFAULT '0.00' COMMENT 'Cost Percent',
  `cost_product` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT 'Cost Product',
  `cost_weight` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT 'Cost Weight',
  `start_weight` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT 'Cost Weight From',
  `time_delivery` varchar(255) DEFAULT NULL COMMENT 'Time Delivery',
  `num_zip_from` int unsigned DEFAULT NULL COMMENT 'Num Zip To',
  `num_zip_to` int unsigned DEFAULT NULL COMMENT 'Num Zip  To',
  `city` varchar(255) NOT NULL DEFAULT '' COMMENT 'City',
  `name_delivery` varchar(255) DEFAULT NULL COMMENT 'Name',
  `unit_weight_conversion` decimal(12,5) unsigned NOT NULL DEFAULT '1.00000' COMMENT 'Unit weight conversion rate',
  `weight_rounding` int unsigned NOT NULL DEFAULT '0' COMMENT 'Weight Rounding',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='amasty_table_rate_replica';

--
-- Table structure for table `amasty_table_rate_sources`
--

CREATE TABLE `amasty_table_rate_sources` (
  `rate_id` int unsigned NOT NULL COMMENT 'Rate Id',
  `source` varchar(255) DEFAULT NULL COMMENT 'Source Code',
  KEY `AMASTY_TABLE_RATE_SOURCES_RATE_ID_SOURCE` (`rate_id`,`source`),
  CONSTRAINT `AMASTY_TABLE_RATE_SOURCES_RATE_ID_AMASTY_TABLE_RATE_ID` FOREIGN KEY (`rate_id`) REFERENCES `amasty_table_rate` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Table structure for table `amasty_xsearch_category_fulltext_cl`
--

CREATE TABLE `amasty_xsearch_category_fulltext_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=204 DEFAULT CHARSET=utf8mb3 COMMENT='amasty_xsearch_category_fulltext_cl';

--
-- Table structure for table `amasty_xsearch_category_fulltext_scope1`
--

CREATE TABLE `amasty_xsearch_category_fulltext_scope1` (
  `entity_id` int unsigned NOT NULL COMMENT 'Entity ID',
  `data_index` longtext COMMENT 'Data index',
  `attribute_id` int unsigned NOT NULL COMMENT 'Attribute_id',
  PRIMARY KEY (`entity_id`,`attribute_id`),
  FULLTEXT KEY `FTI_FULLTEXT_DATA_INDEX` (`data_index`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='amasty_xsearch_category_fulltext_scope1';

--
-- Table structure for table `amasty_xsearch_frontend_product_actions`
--

CREATE TABLE `amasty_xsearch_frontend_product_actions` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Action Log Id',
  `type_id` tinyint unsigned NOT NULL COMMENT 'Action Type ID',
  `customer_identifier` varchar(255) NOT NULL COMMENT 'Customer Identifier',
  `happened_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `store_id` smallint unsigned NOT NULL COMMENT 'Action Store ID',
  `product_id` int unsigned NOT NULL COMMENT 'Product ID',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNQ_65D9002BC796757B7FD41BDBA2E2F1AB` (`type_id`,`store_id`,`customer_identifier`,`product_id`),
  KEY `AMASTY_XSRCH_FRONTEND_PRD_ACTIONS_PRD_ID_CAT_PRD_ENTT_ENTT_ID` (`product_id`),
  KEY `AMASTY_XSEARCH_FRONTEND_PRODUCT_ACTIONS_STORE_ID_STORE_STORE_ID` (`store_id`),
  KEY `IDX_6630023DCAD952BE0E77B4A0E9197E4E` (`type_id`,`store_id`,`customer_identifier`),
  KEY `AMASTY_XSEARCH_FRONTEND_PRODUCT_ACTIONS_HAPPENED_AT` (`happened_at`),
  CONSTRAINT `AMASTY_XSEARCH_FRONTEND_PRODUCT_ACTIONS_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON DELETE CASCADE,
  CONSTRAINT `AMASTY_XSRCH_FRONTEND_PRD_ACTIONS_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Amasty Xsearch Action Log';

--
-- Table structure for table `amasty_xsearch_related_term`
--

CREATE TABLE `amasty_xsearch_related_term` (
  `term_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Term ID',
  `related_term_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Related Term ID',
  `position` int NOT NULL DEFAULT '0' COMMENT 'Position',
  UNIQUE KEY `AMASTY_XSEARCH_RELATED_TERM_TERM_ID_RELATED_TERM_ID_POSITION` (`term_id`,`related_term_id`,`position`),
  KEY `AMASTY_XSEARCH_RELATED_TERM_TERM_ID` (`term_id`),
  CONSTRAINT `AMASTY_XSEARCH_RELATED_TERM_TERM_ID_SEARCH_QUERY_QUERY_ID` FOREIGN KEY (`term_id`) REFERENCES `search_query` (`query_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Related Terms Linking Table';

--
-- Table structure for table `amasty_xsearch_users_search`
--

CREATE TABLE `amasty_xsearch_users_search` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Search ID',
  `user_key` varchar(255) NOT NULL COMMENT 'User',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Created At',
  `query_id` int NOT NULL DEFAULT '0' COMMENT 'Query Id',
  `product_click` smallint DEFAULT NULL COMMENT 'Click On Product',
  PRIMARY KEY (`id`),
  KEY `AMASTY_XSEARCH_USERS_SEARCH_USER_KEY` (`user_key`),
  KEY `AMASTY_XSEARCH_USERS_SEARCH_USER_KEY_CREATED_AT` (`user_key`,`created_at`),
  KEY `AMASTY_XSEARCH_USERS_SEARCH_QUERY_ID_USER_KEY` (`query_id`,`user_key`),
  KEY `AMASTY_XSEARCH_USERS_SEARCH_QUERY_ID` (`query_id`)
) ENGINE=InnoDB AUTO_INCREMENT=326051 DEFAULT CHARSET=utf8mb3 COMMENT='Amasty Xsearch User Searches';

--
-- Table structure for table `authorization_role`
--

CREATE TABLE `authorization_role` (
  `role_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Role ID',
  `parent_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Parent Role ID',
  `tree_level` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Role Tree Level',
  `sort_order` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Role Sort Order',
  `role_type` varchar(1) NOT NULL DEFAULT '0' COMMENT 'Role Type',
  `user_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'User ID',
  `user_type` varchar(16) DEFAULT NULL COMMENT 'User Type',
  `role_name` varchar(50) DEFAULT NULL COMMENT 'Role Name',
  PRIMARY KEY (`role_id`),
  KEY `AUTHORIZATION_ROLE_PARENT_ID_SORT_ORDER` (`parent_id`,`sort_order`),
  KEY `AUTHORIZATION_ROLE_TREE_LEVEL` (`tree_level`)
) ENGINE=InnoDB AUTO_INCREMENT=186 DEFAULT CHARSET=utf8mb3 COMMENT='Admin Role Table';

--
-- Table structure for table `authorization_rule`
--

CREATE TABLE `authorization_rule` (
  `rule_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Rule ID',
  `role_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Role ID',
  `resource_id` varchar(255) DEFAULT NULL COMMENT 'Resource ID',
  `privileges` varchar(20) DEFAULT NULL COMMENT 'Privileges',
  `permission` varchar(10) DEFAULT NULL COMMENT 'Permission',
  PRIMARY KEY (`rule_id`),
  KEY `AUTHORIZATION_RULE_RESOURCE_ID_ROLE_ID` (`resource_id`,`role_id`),
  KEY `AUTHORIZATION_RULE_ROLE_ID_RESOURCE_ID` (`role_id`,`resource_id`),
  CONSTRAINT `AUTHORIZATION_RULE_ROLE_ID_AUTHORIZATION_ROLE_ROLE_ID` FOREIGN KEY (`role_id`) REFERENCES `authorization_role` (`role_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=25786 DEFAULT CHARSET=utf8mb3 COMMENT='Admin Rule Table';

--
-- Table structure for table `braintree_credit_prices`
--

CREATE TABLE `braintree_credit_prices` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Row ID',
  `product_id` int unsigned NOT NULL COMMENT 'Product Id',
  `term` int NOT NULL COMMENT 'Credit Term',
  `monthly_payment` decimal(12,2) NOT NULL COMMENT 'Monthly Payment',
  `instalment_rate` decimal(12,2) NOT NULL COMMENT 'Instalment Rate',
  `cost_of_purchase` decimal(12,2) NOT NULL COMMENT 'Cost of purchase',
  `total_inc_interest` decimal(12,2) NOT NULL COMMENT 'Total Inc Interest',
  PRIMARY KEY (`id`),
  UNIQUE KEY `BRAINTREE_CREDIT_PRICES_PRODUCT_ID_TERM` (`product_id`,`term`),
  KEY `BRAINTREE_CREDIT_PRICES_PRODUCT_ID` (`product_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Braintree credit rates';

--
-- Table structure for table `braintree_transaction_details`
--

CREATE TABLE `braintree_transaction_details` (
  `entity_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `order_id` int unsigned NOT NULL COMMENT 'Order Id',
  `transaction_source` varchar(12) DEFAULT NULL COMMENT 'Transaction Source',
  PRIMARY KEY (`entity_id`),
  KEY `BRAINTREE_TRANSACTION_DETAILS_ORDER_ID` (`order_id`),
  CONSTRAINT `BRAINTREE_TRANSACTION_DETAILS_ORDER_ID_SALES_ORDER_ENTITY_ID` FOREIGN KEY (`order_id`) REFERENCES `sales_order` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Braintree transaction details table';

--
-- Table structure for table `bss_depend_co`
--

CREATE TABLE `bss_depend_co` (
  `dependent_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Option Type Image ID',
  `depend_value` longtext COMMENT 'Depend Values',
  `option_type_id` int unsigned DEFAULT NULL COMMENT 'Option Type ID',
  `option_id` int unsigned DEFAULT NULL COMMENT 'Option ID',
  `increment_id` bigint DEFAULT NULL COMMENT 'Increment Id',
  `product_id` int unsigned NOT NULL COMMENT 'Product Id',
  PRIMARY KEY (`dependent_id`),
  KEY `BSS_DEPEND_CO_OPT_TYPE_ID_CAT_PRD_OPT_TYPE_VAL_OPT_TYPE_ID` (`option_type_id`),
  KEY `BSS_DEPEND_CO_OPTION_ID_CATALOG_PRODUCT_OPTION_OPTION_ID` (`option_id`),
  KEY `BSS_DEPEND_CO_DEPENDENT_ID` (`dependent_id`),
  CONSTRAINT `BSS_DEPEND_CO_OPT_TYPE_ID_CAT_PRD_OPT_TYPE_VAL_OPT_TYPE_ID` FOREIGN KEY (`option_type_id`) REFERENCES `catalog_product_option_type_value` (`option_type_id`) ON DELETE SET NULL,
  CONSTRAINT `BSS_DEPEND_CO_OPTION_ID_CATALOG_PRODUCT_OPTION_OPTION_ID` FOREIGN KEY (`option_id`) REFERENCES `catalog_product_option` (`option_id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=741 DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Product Option Type Dependent';

--
-- Table structure for table `cache`
--

CREATE TABLE `cache` (
  `id` varchar(200) NOT NULL COMMENT 'Cache Id',
  `data` mediumblob COMMENT 'Cache Data',
  `create_time` int DEFAULT NULL COMMENT 'Cache Creation Time',
  `update_time` int DEFAULT NULL COMMENT 'Time of Cache Updating',
  `expire_time` int DEFAULT NULL COMMENT 'Cache Expiration Time',
  PRIMARY KEY (`id`),
  KEY `CACHE_EXPIRE_TIME` (`expire_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Caches';

--
-- Table structure for table `cache_tag`
--

CREATE TABLE `cache_tag` (
  `tag` varchar(100) NOT NULL COMMENT 'Tag',
  `cache_id` varchar(200) NOT NULL COMMENT 'Cache Id',
  PRIMARY KEY (`tag`,`cache_id`),
  KEY `CACHE_TAG_CACHE_ID` (`cache_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Tag Caches';

--
-- Table structure for table `captcha_log`
--

CREATE TABLE `captcha_log` (
  `type` varchar(32) NOT NULL COMMENT 'Type',
  `value` varchar(255) NOT NULL COMMENT 'Value',
  `count` int unsigned NOT NULL DEFAULT '0' COMMENT 'Count',
  `updated_at` timestamp NULL DEFAULT NULL COMMENT 'Update Time',
  PRIMARY KEY (`type`,`value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Count Login Attempts';

--
-- Table structure for table `catalog_category_entity`
--

CREATE TABLE `catalog_category_entity` (
  `entity_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `attribute_set_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Attribute Set ID',
  `parent_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Parent Category ID',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Creation Time',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Update Time',
  `path` varchar(255) NOT NULL COMMENT 'Tree Path',
  `position` int NOT NULL COMMENT 'Position',
  `level` int NOT NULL DEFAULT '0' COMMENT 'Tree Level',
  `children_count` int NOT NULL COMMENT 'Child Count',
  PRIMARY KEY (`entity_id`),
  KEY `CATALOG_CATEGORY_ENTITY_LEVEL` (`level`),
  KEY `CATALOG_CATEGORY_ENTITY_PATH` (`path`)
) ENGINE=InnoDB AUTO_INCREMENT=787 DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Category Table';
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_category_entity_after_insert` AFTER INSERT ON `catalog_category_entity` FOR EACH ROW BEGIN
INSERT IGNORE INTO `amasty_xsearch_category_fulltext_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `catalog_category_product_cl` (`entity_id`) VALUES (NEW.`entity_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_category_entity_after_update` AFTER UPDATE ON `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 `amasty_xsearch_category_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.`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 `catalog_category_product_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_category_entity_after_delete` AFTER DELETE ON `catalog_category_entity` FOR EACH ROW BEGIN
INSERT IGNORE INTO `amasty_xsearch_category_fulltext_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `catalog_category_product_cl` (`entity_id`) VALUES (OLD.`entity_id`);
END */;;
DELIMITER ;

--
-- Table structure for table `catalog_category_entity_datetime`
--

CREATE TABLE `catalog_category_entity_datetime` (
  `value_id` int NOT NULL AUTO_INCREMENT COMMENT 'Value ID',
  `attribute_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Attribute ID',
  `store_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Store ID',
  `entity_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Entity ID',
  `value` datetime DEFAULT NULL COMMENT 'Value',
  PRIMARY KEY (`value_id`),
  UNIQUE KEY `CATALOG_CATEGORY_ENTITY_DATETIME_ENTITY_ID_ATTRIBUTE_ID_STORE_ID` (`entity_id`,`attribute_id`,`store_id`),
  KEY `CATALOG_CATEGORY_ENTITY_DATETIME_ENTITY_ID` (`entity_id`),
  KEY `CATALOG_CATEGORY_ENTITY_DATETIME_ATTRIBUTE_ID` (`attribute_id`),
  KEY `CATALOG_CATEGORY_ENTITY_DATETIME_STORE_ID` (`store_id`),
  CONSTRAINT `CAT_CTGR_ENTT_DTIME_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE,
  CONSTRAINT `CAT_CTGR_ENTT_DTIME_ENTT_ID_CAT_CTGR_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `catalog_category_entity` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `CATALOG_CATEGORY_ENTITY_DATETIME_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=79 DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Category Datetime Attribute Backend Table';
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_category_entity_datetime_after_insert` AFTER INSERT ON `catalog_category_entity_datetime` FOR EACH ROW BEGIN
INSERT IGNORE INTO `amasty_xsearch_category_fulltext_cl` (`entity_id`) VALUES (NEW.`entity_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_category_entity_datetime_after_update` AFTER UPDATE ON `catalog_category_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 `amasty_xsearch_category_fulltext_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_category_entity_datetime_after_delete` AFTER DELETE ON `catalog_category_entity_datetime` FOR EACH ROW BEGIN
INSERT IGNORE INTO `amasty_xsearch_category_fulltext_cl` (`entity_id`) VALUES (OLD.`entity_id`);
END */;;
DELIMITER ;

--
-- Table structure for table `catalog_category_entity_decimal`
--

CREATE TABLE `catalog_category_entity_decimal` (
  `value_id` int NOT NULL AUTO_INCREMENT COMMENT 'Value ID',
  `attribute_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Attribute ID',
  `store_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Store ID',
  `entity_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Entity ID',
  `value` decimal(20,6) DEFAULT NULL COMMENT 'Value',
  PRIMARY KEY (`value_id`),
  UNIQUE KEY `CATALOG_CATEGORY_ENTITY_DECIMAL_ENTITY_ID_ATTRIBUTE_ID_STORE_ID` (`entity_id`,`attribute_id`,`store_id`),
  KEY `CATALOG_CATEGORY_ENTITY_DECIMAL_ENTITY_ID` (`entity_id`),
  KEY `CATALOG_CATEGORY_ENTITY_DECIMAL_ATTRIBUTE_ID` (`attribute_id`),
  KEY `CATALOG_CATEGORY_ENTITY_DECIMAL_STORE_ID` (`store_id`),
  CONSTRAINT `CAT_CTGR_ENTT_DEC_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE,
  CONSTRAINT `CAT_CTGR_ENTT_DEC_ENTT_ID_CAT_CTGR_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `catalog_category_entity` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `CATALOG_CATEGORY_ENTITY_DECIMAL_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Category Decimal Attribute Backend Table';
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_category_entity_decimal_after_insert` AFTER INSERT ON `catalog_category_entity_decimal` FOR EACH ROW BEGIN
INSERT IGNORE INTO `amasty_xsearch_category_fulltext_cl` (`entity_id`) VALUES (NEW.`entity_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_category_entity_decimal_after_update` AFTER UPDATE ON `catalog_category_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 `amasty_xsearch_category_fulltext_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_category_entity_decimal_after_delete` AFTER DELETE ON `catalog_category_entity_decimal` FOR EACH ROW BEGIN
INSERT IGNORE INTO `amasty_xsearch_category_fulltext_cl` (`entity_id`) VALUES (OLD.`entity_id`);
END */;;
DELIMITER ;

--
-- Table structure for table `catalog_category_entity_int`
--

CREATE TABLE `catalog_category_entity_int` (
  `value_id` int NOT NULL AUTO_INCREMENT COMMENT 'Value ID',
  `attribute_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Attribute ID',
  `store_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Store ID',
  `entity_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Entity ID',
  `value` int DEFAULT NULL COMMENT 'Value',
  PRIMARY KEY (`value_id`),
  UNIQUE KEY `CATALOG_CATEGORY_ENTITY_INT_ENTITY_ID_ATTRIBUTE_ID_STORE_ID` (`entity_id`,`attribute_id`,`store_id`),
  KEY `CATALOG_CATEGORY_ENTITY_INT_ENTITY_ID` (`entity_id`),
  KEY `CATALOG_CATEGORY_ENTITY_INT_ATTRIBUTE_ID` (`attribute_id`),
  KEY `CATALOG_CATEGORY_ENTITY_INT_STORE_ID` (`store_id`),
  CONSTRAINT `CAT_CTGR_ENTT_INT_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE,
  CONSTRAINT `CAT_CTGR_ENTT_INT_ENTT_ID_CAT_CTGR_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `catalog_category_entity` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `CATALOG_CATEGORY_ENTITY_INT_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2807 DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Category Integer Attribute Backend Table';
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_category_entity_int_after_insert` AFTER INSERT ON `catalog_category_entity_int` FOR EACH ROW BEGIN
INSERT IGNORE INTO `amasty_xsearch_category_fulltext_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `catalog_category_product_cl` (`entity_id`) VALUES (NEW.`entity_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_category_entity_int_after_update` AFTER UPDATE ON `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 `amasty_xsearch_category_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 `catalog_category_product_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_category_entity_int_after_delete` AFTER DELETE ON `catalog_category_entity_int` FOR EACH ROW BEGIN
INSERT IGNORE INTO `amasty_xsearch_category_fulltext_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `catalog_category_product_cl` (`entity_id`) VALUES (OLD.`entity_id`);
END */;;
DELIMITER ;

--
-- Table structure for table `catalog_category_entity_text`
--

CREATE TABLE `catalog_category_entity_text` (
  `value_id` int NOT NULL AUTO_INCREMENT COMMENT 'Value ID',
  `attribute_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Attribute ID',
  `store_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Store ID',
  `entity_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Entity ID',
  `value` mediumtext COMMENT 'Value',
  PRIMARY KEY (`value_id`),
  UNIQUE KEY `CATALOG_CATEGORY_ENTITY_TEXT_ENTITY_ID_ATTRIBUTE_ID_STORE_ID` (`entity_id`,`attribute_id`,`store_id`),
  KEY `CATALOG_CATEGORY_ENTITY_TEXT_ENTITY_ID` (`entity_id`),
  KEY `CATALOG_CATEGORY_ENTITY_TEXT_ATTRIBUTE_ID` (`attribute_id`),
  KEY `CATALOG_CATEGORY_ENTITY_TEXT_STORE_ID` (`store_id`),
  CONSTRAINT `CAT_CTGR_ENTT_TEXT_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE,
  CONSTRAINT `CAT_CTGR_ENTT_TEXT_ENTT_ID_CAT_CTGR_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `catalog_category_entity` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `CATALOG_CATEGORY_ENTITY_TEXT_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=1413 DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Category Text Attribute Backend Table';
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_category_entity_text_after_insert` AFTER INSERT ON `catalog_category_entity_text` FOR EACH ROW BEGIN
INSERT IGNORE INTO `amasty_xsearch_category_fulltext_cl` (`entity_id`) VALUES (NEW.`entity_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_category_entity_text_after_update` AFTER UPDATE ON `catalog_category_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 `amasty_xsearch_category_fulltext_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_category_entity_text_after_delete` AFTER DELETE ON `catalog_category_entity_text` FOR EACH ROW BEGIN
INSERT IGNORE INTO `amasty_xsearch_category_fulltext_cl` (`entity_id`) VALUES (OLD.`entity_id`);
END */;;
DELIMITER ;

--
-- Table structure for table `catalog_category_entity_varchar`
--

CREATE TABLE `catalog_category_entity_varchar` (
  `value_id` int NOT NULL AUTO_INCREMENT COMMENT 'Value ID',
  `attribute_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Attribute ID',
  `store_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Store ID',
  `entity_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Entity ID',
  `value` varchar(255) DEFAULT NULL COMMENT 'Value',
  PRIMARY KEY (`value_id`),
  UNIQUE KEY `CATALOG_CATEGORY_ENTITY_VARCHAR_ENTITY_ID_ATTRIBUTE_ID_STORE_ID` (`entity_id`,`attribute_id`,`store_id`),
  KEY `CATALOG_CATEGORY_ENTITY_VARCHAR_ENTITY_ID` (`entity_id`),
  KEY `CATALOG_CATEGORY_ENTITY_VARCHAR_ATTRIBUTE_ID` (`attribute_id`),
  KEY `CATALOG_CATEGORY_ENTITY_VARCHAR_STORE_ID` (`store_id`),
  CONSTRAINT `CAT_CTGR_ENTT_VCHR_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE,
  CONSTRAINT `CAT_CTGR_ENTT_VCHR_ENTT_ID_CAT_CTGR_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `catalog_category_entity` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `CATALOG_CATEGORY_ENTITY_VARCHAR_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4437 DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Category Varchar Attribute Backend Table';
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_category_entity_varchar_after_insert` AFTER INSERT ON `catalog_category_entity_varchar` FOR EACH ROW BEGIN
INSERT IGNORE INTO `amasty_xsearch_category_fulltext_cl` (`entity_id`) VALUES (NEW.`entity_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_category_entity_varchar_after_update` AFTER UPDATE ON `catalog_category_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 `amasty_xsearch_category_fulltext_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_category_entity_varchar_after_delete` AFTER DELETE ON `catalog_category_entity_varchar` FOR EACH ROW BEGIN
INSERT IGNORE INTO `amasty_xsearch_category_fulltext_cl` (`entity_id`) VALUES (OLD.`entity_id`);
END */;;
DELIMITER ;

--
-- Table structure for table `catalog_category_product`
--

CREATE TABLE `catalog_category_product` (
  `entity_id` int NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `category_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Category ID',
  `product_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Product ID',
  `position` int NOT NULL DEFAULT '0' COMMENT 'Position',
  PRIMARY KEY (`entity_id`,`category_id`,`product_id`),
  UNIQUE KEY `CATALOG_CATEGORY_PRODUCT_CATEGORY_ID_PRODUCT_ID` (`category_id`,`product_id`),
  KEY `CATALOG_CATEGORY_PRODUCT_PRODUCT_ID` (`product_id`),
  CONSTRAINT `CAT_CTGR_PRD_CTGR_ID_CAT_CTGR_ENTT_ENTT_ID` FOREIGN KEY (`category_id`) REFERENCES `catalog_category_entity` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `CAT_CTGR_PRD_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=24846 DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Product To Category Linkage Table';
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_category_product_after_insert` AFTER INSERT ON `catalog_category_product` FOR EACH ROW BEGIN
INSERT IGNORE INTO `amasty_feed_product_cl` (`entity_id`) VALUES (NEW.`product_id`);
INSERT IGNORE INTO `catalog_product_category_cl` (`entity_id`) VALUES (NEW.`product_id`);
INSERT IGNORE INTO `catalogrule_product_cl` (`entity_id`) VALUES (NEW.`product_id`);
INSERT IGNORE INTO `amasty_elastic_relevance_rule_product_cl` (`entity_id`) VALUES (NEW.`product_id`);
INSERT IGNORE INTO `catalogsearch_fulltext_cl` (`entity_id`) VALUES (NEW.`product_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_category_product_after_update` AFTER UPDATE ON `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 `amasty_feed_product_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 `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 `catalogrule_product_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 `amasty_elastic_relevance_rule_product_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 `catalogsearch_fulltext_cl` (`entity_id`) VALUES (NEW.`product_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_category_product_after_delete` AFTER DELETE ON `catalog_category_product` FOR EACH ROW BEGIN
INSERT IGNORE INTO `amasty_feed_product_cl` (`entity_id`) VALUES (OLD.`product_id`);
INSERT IGNORE INTO `catalog_product_category_cl` (`entity_id`) VALUES (OLD.`product_id`);
INSERT IGNORE INTO `catalogrule_product_cl` (`entity_id`) VALUES (OLD.`product_id`);
INSERT IGNORE INTO `amasty_elastic_relevance_rule_product_cl` (`entity_id`) VALUES (OLD.`product_id`);
INSERT IGNORE INTO `catalogsearch_fulltext_cl` (`entity_id`) VALUES (OLD.`product_id`);
END */;;
DELIMITER ;

--
-- Table structure for table `catalog_category_product_cl`
--

CREATE TABLE `catalog_category_product_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=161 DEFAULT CHARSET=utf8mb3 COMMENT='catalog_category_product_cl';

--
-- Table structure for table `catalog_category_product_index`
--

CREATE TABLE `catalog_category_product_index` (
  `category_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Category ID',
  `product_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Product ID',
  `position` int DEFAULT NULL COMMENT 'Position',
  `is_parent` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Is Parent',
  `store_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Store ID',
  `visibility` smallint unsigned NOT NULL COMMENT 'Visibility',
  PRIMARY KEY (`category_id`,`product_id`,`store_id`),
  KEY `CAT_CTGR_PRD_IDX_PRD_ID_STORE_ID_CTGR_ID_VISIBILITY` (`product_id`,`store_id`,`category_id`,`visibility`),
  KEY `CAT_CTGR_PRD_IDX_STORE_ID_CTGR_ID_VISIBILITY_IS_PARENT_POSITION` (`store_id`,`category_id`,`visibility`,`is_parent`,`position`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Category Product Index';

--
-- Table structure for table `catalog_category_product_index_replica`
--

CREATE TABLE `catalog_category_product_index_replica` (
  `category_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Category ID',
  `product_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Product ID',
  `position` int DEFAULT NULL COMMENT 'Position',
  `is_parent` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Is Parent',
  `store_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Store ID',
  `visibility` smallint unsigned NOT NULL COMMENT 'Visibility',
  PRIMARY KEY (`category_id`,`product_id`,`store_id`),
  KEY `CAT_CTGR_PRD_IDX_PRD_ID_STORE_ID_CTGR_ID_VISIBILITY` (`product_id`,`store_id`,`category_id`,`visibility`),
  KEY `CAT_CTGR_PRD_IDX_STORE_ID_CTGR_ID_VISIBILITY_IS_PARENT_POSITION` (`store_id`,`category_id`,`visibility`,`is_parent`,`position`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Category Product Index';

--
-- Table structure for table `catalog_category_product_index_store1`
--

CREATE TABLE `catalog_category_product_index_store1` (
  `category_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Category Id',
  `product_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Product Id',
  `position` int DEFAULT NULL COMMENT 'Position',
  `is_parent` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Is Parent',
  `store_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Store Id',
  `visibility` smallint unsigned NOT NULL COMMENT 'Visibility',
  PRIMARY KEY (`category_id`,`product_id`,`store_id`),
  KEY `IDX_4B965DC45C352D6E4C9DC0FF50B1FCF5` (`product_id`,`store_id`,`category_id`,`visibility`),
  KEY `IDX_47AB760CD6A893ACEA69A9C2E0112C60` (`store_id`,`category_id`,`visibility`,`is_parent`,`position`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Category Product Index Store1';

--
-- Table structure for table `catalog_category_product_index_store1_replica`
--

CREATE TABLE `catalog_category_product_index_store1_replica` (
  `category_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Category Id',
  `product_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Product Id',
  `position` int DEFAULT NULL COMMENT 'Position',
  `is_parent` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Is Parent',
  `store_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Store Id',
  `visibility` smallint unsigned NOT NULL COMMENT 'Visibility',
  PRIMARY KEY (`category_id`,`product_id`,`store_id`),
  KEY `CAT_CTGR_PRD_IDX_STORE1_PRD_ID_STORE_ID_CTGR_ID_VISIBILITY` (`product_id`,`store_id`,`category_id`,`visibility`),
  KEY `IDX_216E521C8AD125E066D2B0BAB4A08412` (`store_id`,`category_id`,`visibility`,`is_parent`,`position`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Category Product Index Store1 Replica';

--
-- Table structure for table `catalog_category_product_index_tmp`
--

CREATE TABLE `catalog_category_product_index_tmp` (
  `category_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Category ID',
  `product_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Product ID',
  `position` int NOT NULL DEFAULT '0' COMMENT 'Position',
  `is_parent` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Is Parent',
  `store_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Store ID',
  `visibility` smallint unsigned NOT NULL COMMENT 'Visibility',
  PRIMARY KEY (`category_id`,`product_id`,`store_id`),
  KEY `CAT_CTGR_PRD_IDX_TMP_PRD_ID_CTGR_ID_STORE_ID` (`product_id`,`category_id`,`store_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Category Product Indexer temporary table';

--
-- Table structure for table `catalog_compare_item`
--

CREATE TABLE `catalog_compare_item` (
  `catalog_compare_item_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Compare Item ID',
  `visitor_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Visitor ID',
  `customer_id` int unsigned DEFAULT NULL COMMENT 'Customer ID',
  `product_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Product ID',
  `store_id` smallint unsigned DEFAULT NULL COMMENT 'Store ID',
  `list_id` int unsigned DEFAULT NULL COMMENT 'List ID',
  PRIMARY KEY (`catalog_compare_item_id`),
  KEY `CATALOG_COMPARE_ITEM_LIST_ID_CATALOG_COMPARE_LIST_LIST_ID` (`list_id`),
  KEY `CATALOG_COMPARE_ITEM_PRODUCT_ID` (`product_id`),
  KEY `CATALOG_COMPARE_ITEM_VISITOR_ID_PRODUCT_ID` (`visitor_id`,`product_id`),
  KEY `CATALOG_COMPARE_ITEM_CUSTOMER_ID_PRODUCT_ID` (`customer_id`,`product_id`),
  KEY `CATALOG_COMPARE_ITEM_STORE_ID` (`store_id`),
  CONSTRAINT `CATALOG_COMPARE_ITEM_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID` FOREIGN KEY (`customer_id`) REFERENCES `customer_entity` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `CATALOG_COMPARE_ITEM_LIST_ID_CATALOG_COMPARE_LIST_LIST_ID` FOREIGN KEY (`list_id`) REFERENCES `catalog_compare_list` (`list_id`) ON DELETE CASCADE,
  CONSTRAINT `CATALOG_COMPARE_ITEM_PRODUCT_ID_CATALOG_PRODUCT_ENTITY_ENTITY_ID` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `CATALOG_COMPARE_ITEM_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=399 DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Compare Table';

--
-- Table structure for table `catalog_compare_list`
--

CREATE TABLE `catalog_compare_list` (
  `list_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Compare List ID',
  `list_id_mask` varchar(32) DEFAULT NULL COMMENT 'Masked ID',
  `customer_id` int unsigned DEFAULT NULL COMMENT 'Customer ID',
  PRIMARY KEY (`list_id`),
  UNIQUE KEY `CATALOG_COMPARE_LIST_CUSTOMER_ID` (`customer_id`),
  KEY `CATALOG_COMPARE_LIST_LIST_ID_MASK` (`list_id_mask`),
  CONSTRAINT `CATALOG_COMPARE_LIST_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID` FOREIGN KEY (`customer_id`) REFERENCES `customer_entity` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Compare List with hash Table';

--
-- Table structure for table `catalog_eav_attribute`
--

CREATE TABLE `catalog_eav_attribute` (
  `attribute_id` smallint unsigned NOT NULL COMMENT 'Attribute ID',
  `frontend_input_renderer` varchar(255) DEFAULT NULL COMMENT 'Frontend Input Renderer',
  `is_global` smallint unsigned NOT NULL DEFAULT '1' COMMENT 'Is Global',
  `is_visible` smallint unsigned NOT NULL DEFAULT '1' COMMENT 'Is Visible',
  `is_searchable` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Is Searchable',
  `is_filterable` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Is Filterable',
  `is_comparable` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Is Comparable',
  `is_visible_on_front` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Is Visible On Front',
  `is_html_allowed_on_front` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Is HTML Allowed On Front',
  `is_used_for_price_rules` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Is Used For Price Rules',
  `is_filterable_in_search` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Is Filterable In Search',
  `used_in_product_listing` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Is Used In Product Listing',
  `used_for_sort_by` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Is Used For Sorting',
  `apply_to` varchar(255) DEFAULT NULL COMMENT 'Apply To',
  `is_visible_in_advanced_search` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Is Visible In Advanced Search',
  `position` int NOT NULL DEFAULT '0' COMMENT 'Position',
  `is_wysiwyg_enabled` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Is WYSIWYG Enabled',
  `is_used_for_promo_rules` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Is Used For Promo Rules',
  `is_required_in_admin_store` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Is Required In Admin Store',
  `is_used_in_grid` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Is Used in Grid',
  `is_visible_in_grid` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Is Visible in Grid',
  `is_filterable_in_grid` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Is Filterable in Grid',
  `search_weight` float NOT NULL DEFAULT '1' COMMENT 'Search Weight',
  `is_pagebuilder_enabled` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Is PageBuilder Enabled',
  `additional_data` text COMMENT 'Additional swatch attributes data',
  PRIMARY KEY (`attribute_id`),
  KEY `CATALOG_EAV_ATTRIBUTE_USED_FOR_SORT_BY` (`used_for_sort_by`),
  KEY `CATALOG_EAV_ATTRIBUTE_USED_IN_PRODUCT_LISTING` (`used_in_product_listing`),
  CONSTRAINT `CATALOG_EAV_ATTRIBUTE_ATTRIBUTE_ID_EAV_ATTRIBUTE_ATTRIBUTE_ID` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Catalog EAV Attribute Table';

--
-- Table structure for table `catalog_product_attribute_cl`
--

CREATE TABLE `catalog_product_attribute_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=184815 DEFAULT CHARSET=utf8mb3 COMMENT='catalog_product_attribute_cl';

--
-- Table structure for table `catalog_product_bundle_option`
--

CREATE TABLE `catalog_product_bundle_option` (
  `option_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Option ID',
  `parent_id` int unsigned NOT NULL COMMENT 'Parent ID',
  `required` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Required',
  `position` int unsigned NOT NULL DEFAULT '0' COMMENT 'Position',
  `type` varchar(255) DEFAULT NULL COMMENT 'Type',
  PRIMARY KEY (`option_id`),
  KEY `CATALOG_PRODUCT_BUNDLE_OPTION_PARENT_ID` (`parent_id`),
  CONSTRAINT `CAT_PRD_BNDL_OPT_PARENT_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`parent_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2690 DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Product Bundle Option';

--
-- Table structure for table `catalog_product_bundle_option_value`
--

CREATE TABLE `catalog_product_bundle_option_value` (
  `value_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Value ID',
  `option_id` int unsigned NOT NULL COMMENT 'Option ID',
  `store_id` smallint unsigned NOT NULL COMMENT 'Store ID',
  `title` varchar(255) DEFAULT NULL COMMENT 'Title',
  `parent_product_id` int unsigned NOT NULL COMMENT 'Parent Product ID',
  PRIMARY KEY (`value_id`),
  UNIQUE KEY `CAT_PRD_BNDL_OPT_VAL_OPT_ID_PARENT_PRD_ID_STORE_ID` (`option_id`,`parent_product_id`,`store_id`),
  CONSTRAINT `CAT_PRD_BNDL_OPT_VAL_OPT_ID_CAT_PRD_BNDL_OPT_OPT_ID` FOREIGN KEY (`option_id`) REFERENCES `catalog_product_bundle_option` (`option_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=6843 DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Product Bundle Option Value';

--
-- Table structure for table `catalog_product_bundle_price_index`
--

CREATE TABLE `catalog_product_bundle_price_index` (
  `entity_id` int unsigned NOT NULL COMMENT 'Entity ID',
  `website_id` smallint unsigned NOT NULL COMMENT 'Website ID',
  `customer_group_id` int unsigned NOT NULL COMMENT 'Customer Group ID',
  `min_price` decimal(20,6) NOT NULL COMMENT 'Min Price',
  `max_price` decimal(20,6) NOT NULL COMMENT 'Max Price',
  PRIMARY KEY (`entity_id`,`website_id`,`customer_group_id`),
  KEY `CATALOG_PRODUCT_BUNDLE_PRICE_INDEX_WEBSITE_ID` (`website_id`),
  KEY `CATALOG_PRODUCT_BUNDLE_PRICE_INDEX_CUSTOMER_GROUP_ID` (`customer_group_id`),
  CONSTRAINT `CAT_PRD_BNDL_PRICE_IDX_CSTR_GROUP_ID_CSTR_GROUP_CSTR_GROUP_ID` FOREIGN KEY (`customer_group_id`) REFERENCES `customer_group` (`customer_group_id`) ON DELETE CASCADE,
  CONSTRAINT `CAT_PRD_BNDL_PRICE_IDX_ENTT_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `CAT_PRD_BNDL_PRICE_IDX_WS_ID_STORE_WS_WS_ID` FOREIGN KEY (`website_id`) REFERENCES `store_website` (`website_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Product Bundle Price Index';

--
-- Table structure for table `catalog_product_bundle_selection`
--

CREATE TABLE `catalog_product_bundle_selection` (
  `selection_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Selection ID',
  `option_id` int unsigned NOT NULL COMMENT 'Option ID',
  `parent_product_id` int unsigned NOT NULL COMMENT 'Parent Product ID',
  `product_id` int unsigned NOT NULL COMMENT 'Product ID',
  `position` int unsigned NOT NULL DEFAULT '0' COMMENT 'Position',
  `is_default` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Is Default',
  `selection_price_type` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Selection Price Type',
  `selection_price_value` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Selection Price Value',
  `selection_qty` decimal(12,4) DEFAULT NULL COMMENT 'Selection Qty',
  `selection_can_change_qty` smallint NOT NULL DEFAULT '0' COMMENT 'Selection Can Change Qty',
  PRIMARY KEY (`selection_id`),
  KEY `CATALOG_PRODUCT_BUNDLE_SELECTION_OPTION_ID` (`option_id`),
  KEY `CATALOG_PRODUCT_BUNDLE_SELECTION_PRODUCT_ID` (`product_id`),
  CONSTRAINT `CAT_PRD_BNDL_SELECTION_OPT_ID_CAT_PRD_BNDL_OPT_OPT_ID` FOREIGN KEY (`option_id`) REFERENCES `catalog_product_bundle_option` (`option_id`) ON DELETE CASCADE,
  CONSTRAINT `CAT_PRD_BNDL_SELECTION_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4392 DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Product Bundle Selection';
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_product_bundle_selection_after_insert` AFTER INSERT ON `catalog_product_bundle_selection` FOR EACH ROW BEGIN
INSERT IGNORE INTO `catalogsearch_fulltext_cl` (`entity_id`) VALUES (NEW.`parent_product_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_product_bundle_selection_after_update` AFTER UPDATE ON `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 `catalogsearch_fulltext_cl` (`entity_id`) VALUES (NEW.`parent_product_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_product_bundle_selection_after_delete` AFTER DELETE ON `catalog_product_bundle_selection` FOR EACH ROW BEGIN
INSERT IGNORE INTO `catalogsearch_fulltext_cl` (`entity_id`) VALUES (OLD.`parent_product_id`);
END */;;
DELIMITER ;

--
-- Table structure for table `catalog_product_bundle_selection_price`
--

CREATE TABLE `catalog_product_bundle_selection_price` (
  `selection_id` int unsigned NOT NULL COMMENT 'Selection ID',
  `website_id` smallint unsigned NOT NULL COMMENT 'Website ID',
  `selection_price_type` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Selection Price Type',
  `selection_price_value` decimal(20,6) NOT NULL DEFAULT '0.000000' COMMENT 'Selection Price Value',
  `parent_product_id` int unsigned NOT NULL COMMENT 'Parent Product ID',
  PRIMARY KEY (`selection_id`,`parent_product_id`,`website_id`),
  KEY `CATALOG_PRODUCT_BUNDLE_SELECTION_PRICE_WEBSITE_ID` (`website_id`),
  CONSTRAINT `CAT_PRD_BNDL_SELECTION_PRICE_WS_ID_STORE_WS_WS_ID` FOREIGN KEY (`website_id`) REFERENCES `store_website` (`website_id`) ON DELETE CASCADE,
  CONSTRAINT `FK_DCF37523AA05D770A70AA4ED7C2616E4` FOREIGN KEY (`selection_id`) REFERENCES `catalog_product_bundle_selection` (`selection_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Product Bundle Selection Price';

--
-- Table structure for table `catalog_product_bundle_stock_index`
--

CREATE TABLE `catalog_product_bundle_stock_index` (
  `entity_id` int unsigned NOT NULL COMMENT 'Entity ID',
  `website_id` smallint unsigned NOT NULL COMMENT 'Website ID',
  `stock_id` smallint unsigned NOT NULL COMMENT 'Stock ID',
  `option_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Option ID',
  `stock_status` smallint DEFAULT '0' COMMENT 'Stock Status',
  PRIMARY KEY (`entity_id`,`website_id`,`stock_id`,`option_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Product Bundle Stock Index';

--
-- Table structure for table `catalog_product_category_cl`
--

CREATE TABLE `catalog_product_category_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=125921 DEFAULT CHARSET=utf8mb3 COMMENT='catalog_product_category_cl';

--
-- Table structure for table `catalog_product_entity`
--

CREATE TABLE `catalog_product_entity` (
  `entity_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `attribute_set_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Attribute Set ID',
  `type_id` varchar(32) NOT NULL DEFAULT 'simple' COMMENT 'Type ID',
  `sku` varchar(64) NOT NULL COMMENT 'SKU',
  `has_options` smallint NOT NULL DEFAULT '0' COMMENT 'Has Options',
  `required_options` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Required Options',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Creation Time',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Update Time',
  PRIMARY KEY (`entity_id`),
  KEY `CATALOG_PRODUCT_ENTITY_ATTRIBUTE_SET_ID` (`attribute_set_id`),
  KEY `CATALOG_PRODUCT_ENTITY_SKU` (`sku`)
) ENGINE=InnoDB AUTO_INCREMENT=34580 DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Product Table';
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_product_entity_after_insert` AFTER INSERT ON `catalog_product_entity` FOR EACH ROW BEGIN
INSERT IGNORE INTO `amasty_feed_product_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `catalogrule_product_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `catalog_product_price_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `amasty_elastic_relevance_rule_product_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `catalogsearch_fulltext_cl` (`entity_id`) VALUES (NEW.`entity_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_product_entity_after_update` AFTER UPDATE ON `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 `amasty_feed_product_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 `catalogrule_product_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 `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 `amasty_elastic_relevance_rule_product_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 `catalogsearch_fulltext_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_product_entity_after_delete` AFTER DELETE ON `catalog_product_entity` FOR EACH ROW BEGIN
INSERT IGNORE INTO `amasty_feed_product_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `catalogrule_product_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `catalog_product_price_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `amasty_elastic_relevance_rule_product_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `catalogsearch_fulltext_cl` (`entity_id`) VALUES (OLD.`entity_id`);
END */;;
DELIMITER ;

--
-- Table structure for table `catalog_product_entity_datetime`
--

CREATE TABLE `catalog_product_entity_datetime` (
  `value_id` int NOT NULL AUTO_INCREMENT COMMENT 'Value ID',
  `attribute_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Attribute ID',
  `store_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Store ID',
  `entity_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Entity ID',
  `value` datetime DEFAULT NULL COMMENT 'Value',
  PRIMARY KEY (`value_id`),
  UNIQUE KEY `CATALOG_PRODUCT_ENTITY_DATETIME_ENTITY_ID_ATTRIBUTE_ID_STORE_ID` (`entity_id`,`attribute_id`,`store_id`),
  KEY `CATALOG_PRODUCT_ENTITY_DATETIME_ATTRIBUTE_ID` (`attribute_id`),
  KEY `CATALOG_PRODUCT_ENTITY_DATETIME_STORE_ID` (`store_id`),
  CONSTRAINT `CAT_PRD_ENTT_DTIME_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE,
  CONSTRAINT `CAT_PRD_ENTT_DTIME_ENTT_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `CATALOG_PRODUCT_ENTITY_DATETIME_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=8927 DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Product Datetime Attribute Backend Table';
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_product_entity_datetime_after_insert` AFTER INSERT ON `catalog_product_entity_datetime` FOR EACH ROW BEGIN
INSERT IGNORE INTO `amasty_feed_product_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `catalogrule_product_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `catalog_product_price_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `amasty_elastic_relevance_rule_product_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `catalogsearch_fulltext_cl` (`entity_id`) VALUES (NEW.`entity_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_product_entity_datetime_after_update` AFTER UPDATE ON `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 `amasty_feed_product_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 `catalogrule_product_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 `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 `amasty_elastic_relevance_rule_product_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 `catalogsearch_fulltext_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_product_entity_datetime_after_delete` AFTER DELETE ON `catalog_product_entity_datetime` FOR EACH ROW BEGIN
INSERT IGNORE INTO `amasty_feed_product_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `catalogrule_product_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `catalog_product_price_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `amasty_elastic_relevance_rule_product_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `catalogsearch_fulltext_cl` (`entity_id`) VALUES (OLD.`entity_id`);
END */;;
DELIMITER ;

--
-- Table structure for table `catalog_product_entity_decimal`
--

CREATE TABLE `catalog_product_entity_decimal` (
  `value_id` int NOT NULL AUTO_INCREMENT COMMENT 'Value ID',
  `attribute_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Attribute ID',
  `store_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Store ID',
  `entity_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Entity ID',
  `value` decimal(20,6) DEFAULT NULL COMMENT 'Value',
  PRIMARY KEY (`value_id`),
  UNIQUE KEY `CATALOG_PRODUCT_ENTITY_DECIMAL_ENTITY_ID_ATTRIBUTE_ID_STORE_ID` (`entity_id`,`attribute_id`,`store_id`),
  KEY `CATALOG_PRODUCT_ENTITY_DECIMAL_STORE_ID` (`store_id`),
  KEY `CATALOG_PRODUCT_ENTITY_DECIMAL_ATTRIBUTE_ID` (`attribute_id`),
  CONSTRAINT `CAT_PRD_ENTT_DEC_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE,
  CONSTRAINT `CAT_PRD_ENTT_DEC_ENTT_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `CATALOG_PRODUCT_ENTITY_DECIMAL_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=37785 DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Product Decimal Attribute Backend Table';
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_product_entity_decimal_after_insert` AFTER INSERT ON `catalog_product_entity_decimal` FOR EACH ROW BEGIN
INSERT IGNORE INTO `amasty_feed_product_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `catalog_product_attribute_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `catalogrule_product_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `catalog_product_price_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `amasty_elastic_relevance_rule_product_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `catalogsearch_fulltext_cl` (`entity_id`) VALUES (NEW.`entity_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_product_entity_decimal_after_update` AFTER UPDATE ON `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 `amasty_feed_product_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 `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 `catalogrule_product_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 `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 `amasty_elastic_relevance_rule_product_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 `catalogsearch_fulltext_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_product_entity_decimal_after_delete` AFTER DELETE ON `catalog_product_entity_decimal` FOR EACH ROW BEGIN
INSERT IGNORE INTO `amasty_feed_product_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `catalog_product_attribute_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `catalogrule_product_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `catalog_product_price_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `amasty_elastic_relevance_rule_product_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `catalogsearch_fulltext_cl` (`entity_id`) VALUES (OLD.`entity_id`);
END */;;
DELIMITER ;

--
-- Table structure for table `catalog_product_entity_gallery`
--

CREATE TABLE `catalog_product_entity_gallery` (
  `value_id` int NOT NULL AUTO_INCREMENT COMMENT 'Value ID',
  `attribute_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Attribute ID',
  `store_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Store ID',
  `entity_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Entity ID',
  `position` int NOT NULL DEFAULT '0' COMMENT 'Position',
  `value` varchar(255) DEFAULT NULL COMMENT 'Value',
  PRIMARY KEY (`value_id`),
  UNIQUE KEY `CATALOG_PRODUCT_ENTITY_GALLERY_ENTITY_ID_ATTRIBUTE_ID_STORE_ID` (`entity_id`,`attribute_id`,`store_id`),
  KEY `CATALOG_PRODUCT_ENTITY_GALLERY_ENTITY_ID` (`entity_id`),
  KEY `CATALOG_PRODUCT_ENTITY_GALLERY_ATTRIBUTE_ID` (`attribute_id`),
  KEY `CATALOG_PRODUCT_ENTITY_GALLERY_STORE_ID` (`store_id`),
  CONSTRAINT `CAT_PRD_ENTT_GLR_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE,
  CONSTRAINT `CAT_PRD_ENTT_GLR_ENTT_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `CATALOG_PRODUCT_ENTITY_GALLERY_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Product Gallery Attribute Backend Table';
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_product_entity_gallery_after_insert` AFTER INSERT ON `catalog_product_entity_gallery` FOR EACH ROW BEGIN
INSERT IGNORE INTO `amasty_feed_product_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `amasty_elastic_relevance_rule_product_cl` (`entity_id`) VALUES (NEW.`entity_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_product_entity_gallery_after_update` AFTER UPDATE ON `catalog_product_entity_gallery` 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.`position` <=> OLD.`position`) OR NOT(NEW.`value` <=> OLD.`value`)) THEN INSERT IGNORE INTO `amasty_feed_product_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.`position` <=> OLD.`position`) OR NOT(NEW.`value` <=> OLD.`value`)) THEN INSERT IGNORE INTO `amasty_elastic_relevance_rule_product_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_product_entity_gallery_after_delete` AFTER DELETE ON `catalog_product_entity_gallery` FOR EACH ROW BEGIN
INSERT IGNORE INTO `amasty_feed_product_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `amasty_elastic_relevance_rule_product_cl` (`entity_id`) VALUES (OLD.`entity_id`);
END */;;
DELIMITER ;

--
-- Table structure for table `catalog_product_entity_int`
--

CREATE TABLE `catalog_product_entity_int` (
  `value_id` int NOT NULL AUTO_INCREMENT COMMENT 'Value ID',
  `attribute_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Attribute ID',
  `store_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Store ID',
  `entity_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Entity ID',
  `value` int DEFAULT NULL COMMENT 'Value',
  PRIMARY KEY (`value_id`),
  UNIQUE KEY `CATALOG_PRODUCT_ENTITY_INT_ENTITY_ID_ATTRIBUTE_ID_STORE_ID` (`entity_id`,`attribute_id`,`store_id`),
  KEY `CATALOG_PRODUCT_ENTITY_INT_ATTRIBUTE_ID` (`attribute_id`),
  KEY `CATALOG_PRODUCT_ENTITY_INT_STORE_ID` (`store_id`),
  KEY `CATALOG_PRODUCT_ENTITY_INT_ATTRIBUTE_ID_STORE_ID_VALUE` (`attribute_id`,`store_id`,`value`),
  CONSTRAINT `CAT_PRD_ENTT_INT_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE,
  CONSTRAINT `CAT_PRD_ENTT_INT_ENTT_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `CATALOG_PRODUCT_ENTITY_INT_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=193438 DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Product Integer Attribute Backend Table';
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_product_entity_int_after_insert` AFTER INSERT ON `catalog_product_entity_int` FOR EACH ROW BEGIN
INSERT IGNORE INTO `amasty_feed_product_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `catalog_product_category_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `catalog_product_attribute_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `cataloginventory_stock_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `catalogrule_product_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `catalog_product_price_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `amasty_elastic_relevance_rule_product_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `catalogsearch_fulltext_cl` (`entity_id`) VALUES (NEW.`entity_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_product_entity_int_after_update` AFTER UPDATE ON `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 `amasty_feed_product_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 `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 `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 `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 `catalogrule_product_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 `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 `amasty_elastic_relevance_rule_product_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 `catalogsearch_fulltext_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_product_entity_int_after_delete` AFTER DELETE ON `catalog_product_entity_int` FOR EACH ROW BEGIN
INSERT IGNORE INTO `amasty_feed_product_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `catalog_product_category_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `catalog_product_attribute_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `cataloginventory_stock_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `catalogrule_product_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `catalog_product_price_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `amasty_elastic_relevance_rule_product_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `catalogsearch_fulltext_cl` (`entity_id`) VALUES (OLD.`entity_id`);
END */;;
DELIMITER ;

--
-- Table structure for table `catalog_product_entity_media_gallery`
--

CREATE TABLE `catalog_product_entity_media_gallery` (
  `value_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Value ID',
  `attribute_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Attribute ID',
  `value` varchar(255) DEFAULT NULL COMMENT 'Value',
  `media_type` varchar(32) NOT NULL DEFAULT 'image' COMMENT 'Media entry type',
  `disabled` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Visibility status',
  PRIMARY KEY (`value_id`),
  KEY `CATALOG_PRODUCT_ENTITY_MEDIA_GALLERY_ATTRIBUTE_ID` (`attribute_id`),
  CONSTRAINT `CAT_PRD_ENTT_MDA_GLR_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=17995 DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Product Media Gallery Attribute Backend Table';

--
-- Table structure for table `catalog_product_entity_media_gallery_value`
--

CREATE TABLE `catalog_product_entity_media_gallery_value` (
  `value_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Value ID',
  `store_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Store ID',
  `entity_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Entity ID',
  `label` varchar(255) DEFAULT NULL COMMENT 'Label',
  `position` int unsigned DEFAULT NULL COMMENT 'Position',
  `disabled` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Is Disabled',
  `record_id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Record ID',
  PRIMARY KEY (`record_id`),
  KEY `CATALOG_PRODUCT_ENTITY_MEDIA_GALLERY_VALUE_STORE_ID` (`store_id`),
  KEY `CATALOG_PRODUCT_ENTITY_MEDIA_GALLERY_VALUE_ENTITY_ID` (`entity_id`),
  KEY `CATALOG_PRODUCT_ENTITY_MEDIA_GALLERY_VALUE_VALUE_ID` (`value_id`),
  KEY `CAT_PRD_ENTT_MDA_GLR_VAL_ENTT_ID_VAL_ID_STORE_ID` (`entity_id`,`value_id`,`store_id`),
  CONSTRAINT `CAT_PRD_ENTT_MDA_GLR_VAL_ENTT_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `CAT_PRD_ENTT_MDA_GLR_VAL_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON DELETE CASCADE,
  CONSTRAINT `CAT_PRD_ENTT_MDA_GLR_VAL_VAL_ID_CAT_PRD_ENTT_MDA_GLR_VAL_ID` FOREIGN KEY (`value_id`) REFERENCES `catalog_product_entity_media_gallery` (`value_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=39395 DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Product Media Gallery Attribute Value Table';
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_product_entity_media_gallery_value_after_insert` AFTER INSERT ON `catalog_product_entity_media_gallery_value` FOR EACH ROW BEGIN
INSERT IGNORE INTO `amasty_feed_product_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `amasty_elastic_relevance_rule_product_cl` (`entity_id`) VALUES (NEW.`entity_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_product_entity_media_gallery_value_after_update` AFTER UPDATE ON `catalog_product_entity_media_gallery_value` FOR EACH ROW BEGIN
IF (NOT(NEW.`value_id` <=> OLD.`value_id`) OR NOT(NEW.`store_id` <=> OLD.`store_id`) OR NOT(NEW.`entity_id` <=> OLD.`entity_id`) OR NOT(NEW.`label` <=> OLD.`label`) OR NOT(NEW.`position` <=> OLD.`position`) OR NOT(NEW.`disabled` <=> OLD.`disabled`) OR NOT(NEW.`record_id` <=> OLD.`record_id`)) THEN INSERT IGNORE INTO `amasty_feed_product_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
IF (NOT(NEW.`value_id` <=> OLD.`value_id`) OR NOT(NEW.`store_id` <=> OLD.`store_id`) OR NOT(NEW.`entity_id` <=> OLD.`entity_id`) OR NOT(NEW.`label` <=> OLD.`label`) OR NOT(NEW.`position` <=> OLD.`position`) OR NOT(NEW.`disabled` <=> OLD.`disabled`) OR NOT(NEW.`record_id` <=> OLD.`record_id`)) THEN INSERT IGNORE INTO `amasty_elastic_relevance_rule_product_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_product_entity_media_gallery_value_after_delete` AFTER DELETE ON `catalog_product_entity_media_gallery_value` FOR EACH ROW BEGIN
INSERT IGNORE INTO `amasty_feed_product_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `amasty_elastic_relevance_rule_product_cl` (`entity_id`) VALUES (OLD.`entity_id`);
END */;;
DELIMITER ;

--
-- Table structure for table `catalog_product_entity_media_gallery_value_to_entity`
--

CREATE TABLE `catalog_product_entity_media_gallery_value_to_entity` (
  `value_id` int unsigned NOT NULL COMMENT 'Value media Entry ID',
  `entity_id` int unsigned NOT NULL COMMENT 'Product Entity ID',
  PRIMARY KEY (`value_id`,`entity_id`),
  KEY `CAT_PRD_ENTT_MDA_GLR_VAL_TO_ENTT_ENTT_ID_CAT_PRD_ENTT_ENTT_ID` (`entity_id`),
  CONSTRAINT `CAT_PRD_ENTT_MDA_GLR_VAL_TO_ENTT_ENTT_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `FK_A6C6C8FAA386736921D3A7C4B50B1185` FOREIGN KEY (`value_id`) REFERENCES `catalog_product_entity_media_gallery` (`value_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Link Media value to Product entity table';

--
-- Table structure for table `catalog_product_entity_media_gallery_value_video`
--

CREATE TABLE `catalog_product_entity_media_gallery_value_video` (
  `value_id` int unsigned NOT NULL COMMENT 'Media Entity ID',
  `store_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Store ID',
  `provider` varchar(32) DEFAULT NULL COMMENT 'Video provider ID',
  `url` text COMMENT 'Video URL',
  `title` varchar(255) DEFAULT NULL COMMENT 'Title',
  `description` text COMMENT 'Page Meta Description',
  `metadata` text COMMENT 'Video meta data',
  PRIMARY KEY (`value_id`,`store_id`),
  KEY `CAT_PRD_ENTT_MDA_GLR_VAL_VIDEO_STORE_ID_STORE_STORE_ID` (`store_id`),
  CONSTRAINT `CAT_PRD_ENTT_MDA_GLR_VAL_VIDEO_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON DELETE CASCADE,
  CONSTRAINT `FK_6FDF205946906B0E653E60AA769899F8` FOREIGN KEY (`value_id`) REFERENCES `catalog_product_entity_media_gallery` (`value_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Product Video Table';

--
-- Table structure for table `catalog_product_entity_text`
--

CREATE TABLE `catalog_product_entity_text` (
  `value_id` int NOT NULL AUTO_INCREMENT COMMENT 'Value ID',
  `attribute_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Attribute ID',
  `store_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Store ID',
  `entity_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Entity ID',
  `value` mediumtext COMMENT 'Value',
  PRIMARY KEY (`value_id`),
  UNIQUE KEY `CATALOG_PRODUCT_ENTITY_TEXT_ENTITY_ID_ATTRIBUTE_ID_STORE_ID` (`entity_id`,`attribute_id`,`store_id`),
  KEY `CATALOG_PRODUCT_ENTITY_TEXT_ATTRIBUTE_ID` (`attribute_id`),
  KEY `CATALOG_PRODUCT_ENTITY_TEXT_STORE_ID` (`store_id`),
  CONSTRAINT `CAT_PRD_ENTT_TEXT_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE,
  CONSTRAINT `CAT_PRD_ENTT_TEXT_ENTT_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `CATALOG_PRODUCT_ENTITY_TEXT_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=71093 DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Product Text Attribute Backend Table';
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_product_entity_text_after_insert` AFTER INSERT ON `catalog_product_entity_text` FOR EACH ROW BEGIN
INSERT IGNORE INTO `amasty_feed_product_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `catalogrule_product_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `amasty_elastic_relevance_rule_product_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `catalogsearch_fulltext_cl` (`entity_id`) VALUES (NEW.`entity_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_product_entity_text_after_update` AFTER UPDATE ON `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 `amasty_feed_product_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 `catalogrule_product_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 `amasty_elastic_relevance_rule_product_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 `catalogsearch_fulltext_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_product_entity_text_after_delete` AFTER DELETE ON `catalog_product_entity_text` FOR EACH ROW BEGIN
INSERT IGNORE INTO `amasty_feed_product_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `catalogrule_product_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `amasty_elastic_relevance_rule_product_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `catalogsearch_fulltext_cl` (`entity_id`) VALUES (OLD.`entity_id`);
END */;;
DELIMITER ;

--
-- Table structure for table `catalog_product_entity_tier_price`
--

CREATE TABLE `catalog_product_entity_tier_price` (
  `value_id` int NOT NULL AUTO_INCREMENT COMMENT 'Value ID',
  `entity_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Entity ID',
  `all_groups` smallint unsigned NOT NULL DEFAULT '1' COMMENT 'Is Applicable To All Customer Groups',
  `customer_group_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Customer Group ID',
  `qty` decimal(12,4) NOT NULL DEFAULT '1.0000' COMMENT 'QTY',
  `value` decimal(20,6) NOT NULL DEFAULT '0.000000' COMMENT 'Value',
  `website_id` smallint unsigned NOT NULL COMMENT 'Website ID',
  `percentage_value` decimal(5,2) DEFAULT NULL COMMENT 'Percentage value',
  PRIMARY KEY (`value_id`),
  UNIQUE KEY `UNQ_E8AB433B9ACB00343ABB312AD2FAB087` (`entity_id`,`all_groups`,`customer_group_id`,`qty`,`website_id`),
  KEY `CATALOG_PRODUCT_ENTITY_TIER_PRICE_CUSTOMER_GROUP_ID` (`customer_group_id`),
  KEY `CATALOG_PRODUCT_ENTITY_TIER_PRICE_WEBSITE_ID` (`website_id`),
  CONSTRAINT `CAT_PRD_ENTT_TIER_PRICE_CSTR_GROUP_ID_CSTR_GROUP_CSTR_GROUP_ID` FOREIGN KEY (`customer_group_id`) REFERENCES `customer_group` (`customer_group_id`) ON DELETE CASCADE,
  CONSTRAINT `CAT_PRD_ENTT_TIER_PRICE_ENTT_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `CAT_PRD_ENTT_TIER_PRICE_WS_ID_STORE_WS_WS_ID` FOREIGN KEY (`website_id`) REFERENCES `store_website` (`website_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=791 DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Product Tier Price Attribute Backend Table';
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_product_entity_tier_price_after_insert` AFTER INSERT ON `catalog_product_entity_tier_price` FOR EACH ROW BEGIN
INSERT IGNORE INTO `amasty_feed_product_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `catalogrule_product_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `catalog_product_price_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `amasty_elastic_relevance_rule_product_cl` (`entity_id`) VALUES (NEW.`entity_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_product_entity_tier_price_after_update` AFTER UPDATE ON `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 `amasty_feed_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 `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 `catalog_product_price_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 `amasty_elastic_relevance_rule_product_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_product_entity_tier_price_after_delete` AFTER DELETE ON `catalog_product_entity_tier_price` FOR EACH ROW BEGIN
INSERT IGNORE INTO `amasty_feed_product_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `catalogrule_product_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `catalog_product_price_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `amasty_elastic_relevance_rule_product_cl` (`entity_id`) VALUES (OLD.`entity_id`);
END */;;
DELIMITER ;

--
-- Table structure for table `catalog_product_entity_varchar`
--

CREATE TABLE `catalog_product_entity_varchar` (
  `value_id` int NOT NULL AUTO_INCREMENT COMMENT 'Value ID',
  `attribute_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Attribute ID',
  `store_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Store ID',
  `entity_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Entity ID',
  `value` varchar(255) DEFAULT NULL COMMENT 'Value',
  PRIMARY KEY (`value_id`),
  UNIQUE KEY `CATALOG_PRODUCT_ENTITY_VARCHAR_ENTITY_ID_ATTRIBUTE_ID_STORE_ID` (`entity_id`,`attribute_id`,`store_id`),
  KEY `CATALOG_PRODUCT_ENTITY_VARCHAR_ATTRIBUTE_ID` (`attribute_id`),
  KEY `CATALOG_PRODUCT_ENTITY_VARCHAR_STORE_ID` (`store_id`),
  CONSTRAINT `CAT_PRD_ENTT_VCHR_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE,
  CONSTRAINT `CAT_PRD_ENTT_VCHR_ENTT_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `CATALOG_PRODUCT_ENTITY_VARCHAR_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=218163 DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Product Varchar Attribute Backend Table';
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_product_entity_varchar_after_insert` AFTER INSERT ON `catalog_product_entity_varchar` FOR EACH ROW BEGIN
INSERT IGNORE INTO `amasty_feed_product_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `catalog_product_attribute_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `catalogrule_product_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `amasty_elastic_relevance_rule_product_cl` (`entity_id`) VALUES (NEW.`entity_id`);
INSERT IGNORE INTO `catalogsearch_fulltext_cl` (`entity_id`) VALUES (NEW.`entity_id`);
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_product_entity_varchar_after_update` AFTER UPDATE ON `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 `amasty_feed_product_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 `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 `catalogrule_product_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 `amasty_elastic_relevance_rule_product_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 `catalogsearch_fulltext_cl` (`entity_id`) VALUES (NEW.`entity_id`); END IF;
END */;;
DELIMITER ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`developer`@`%`*/ /*!50003 TRIGGER `trg_catalog_product_entity_varchar_after_delete` AFTER DELETE ON `catalog_product_entity_varchar` FOR EACH ROW BEGIN
INSERT IGNORE INTO `amasty_feed_product_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `catalog_product_attribute_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `catalogrule_product_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `amasty_elastic_relevance_rule_product_cl` (`entity_id`) VALUES (OLD.`entity_id`);
INSERT IGNORE INTO `catalogsearch_fulltext_cl` (`entity_id`) VALUES (OLD.`entity_id`);
END */;;
DELIMITER ;

--
-- Table structure for table `catalog_product_frontend_action`
--

CREATE TABLE `catalog_product_frontend_action` (
  `action_id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'Product Action ID',
  `type_id` varchar(64) NOT NULL COMMENT 'Type of product action',
  `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',
  `added_at` bigint NOT NULL COMMENT 'Added At',
  PRIMARY KEY (`action_id`),
  UNIQUE KEY `CATALOG_PRODUCT_FRONTEND_ACTION_VISITOR_ID_PRODUCT_ID_TYPE_ID` (`visitor_id`,`product_id`,`type_id`),
  UNIQUE KEY `CATALOG_PRODUCT_FRONTEND_ACTION_CUSTOMER_ID_PRODUCT_ID_TYPE_ID` (`customer_id`,`product_id`,`type_id`),
  KEY `CAT_PRD_FRONTEND_ACTION_PRD_ID_CAT_PRD_ENTT_ENTT_ID` (`product_id`),
  CONSTRAINT `CAT_PRD_FRONTEND_ACTION_CSTR_ID_CSTR_ENTT_ENTT_ID` FOREIGN KEY (`customer_id`) REFERENCES `customer_entity` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `CAT_PRD_FRONTEND_ACTION_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Product Frontend Action Table';

--
-- Table structure for table `catalog_product_index_eav`
--

CREATE TABLE `catalog_product_index_eav` (
  `entity_id` int unsigned NOT NULL COMMENT 'Entity ID',
  `attribute_id` smallint unsigned NOT NULL COMMENT 'Attribute ID',
  `store_id` smallint unsigned NOT NULL COMMENT 'Store ID',
  `value` int unsigned NOT NULL COMMENT 'Value',
  `source_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Original entity ID for attribute value',
  PRIMARY KEY (`entity_id`,`attribute_id`,`store_id`,`value`,`source_id`),
  KEY `CATALOG_PRODUCT_INDEX_EAV_ATTRIBUTE_ID` (`attribute_id`),
  KEY `CATALOG_PRODUCT_INDEX_EAV_STORE_ID` (`store_id`),
  KEY `CATALOG_PRODUCT_INDEX_EAV_VALUE` (`value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Product EAV Index Table';

--
-- Table structure for table `catalog_product_index_eav_decimal`
--

CREATE TABLE `catalog_product_index_eav_decimal` (
  `entity_id` int unsigned NOT NULL COMMENT 'Entity ID',
  `attribute_id` smallint unsigned NOT NULL COMMENT 'Attribute ID',
  `store_id` smallint unsigned NOT NULL COMMENT 'Store ID',
  `value` decimal(12,4) NOT NULL COMMENT 'Value',
  `source_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Original entity ID for attribute value',
  PRIMARY KEY (`entity_id`,`attribute_id`,`store_id`,`value`,`source_id`),
  KEY `CATALOG_PRODUCT_INDEX_EAV_DECIMAL_ATTRIBUTE_ID` (`attribute_id`),
  KEY `CATALOG_PRODUCT_INDEX_EAV_DECIMAL_STORE_ID` (`store_id`),
  KEY `CATALOG_PRODUCT_INDEX_EAV_DECIMAL_VALUE` (`value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Product EAV Decimal Index Table';

--
-- Table structure for table `catalog_product_index_eav_decimal_idx`
--

CREATE TABLE `catalog_product_index_eav_decimal_idx` (
  `entity_id` int unsigned NOT NULL COMMENT 'Entity ID',
  `attribute_id` smallint unsigned NOT NULL COMMENT 'Attribute ID',
  `store_id` smallint unsigned NOT NULL COMMENT 'Store ID',
  `value` decimal(12,4) NOT NULL COMMENT 'Value',
  `source_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Original entity ID for attribute value',
  PRIMARY KEY (`entity_id`,`attribute_id`,`store_id`,`value`,`source_id`),
  KEY `CATALOG_PRODUCT_INDEX_EAV_DECIMAL_IDX_ATTRIBUTE_ID` (`attribute_id`),
  KEY `CATALOG_PRODUCT_INDEX_EAV_DECIMAL_IDX_STORE_ID` (`store_id`),
  KEY `CATALOG_PRODUCT_INDEX_EAV_DECIMAL_IDX_VALUE` (`value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Product EAV Decimal Indexer Index Table';

--
-- Table structure for table `catalog_product_index_eav_decimal_replica`
--

CREATE TABLE `catalog_product_index_eav_decimal_replica` (
  `entity_id` int unsigned NOT NULL COMMENT 'Entity ID',
  `attribute_id` smallint unsigned NOT NULL COMMENT 'Attribute ID',
  `store_id` smallint unsigned NOT NULL COMMENT 'Store ID',
  `value` decimal(12,4) NOT NULL COMMENT 'Value',
  `source_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Original entity ID for attribute value',
  PRIMARY KEY (`entity_id`,`attribute_id`,`store_id`,`value`,`source_id`),
  KEY `CATALOG_PRODUCT_INDEX_EAV_DECIMAL_ATTRIBUTE_ID` (`attribute_id`),
  KEY `CATALOG_PRODUCT_INDEX_EAV_DECIMAL_STORE_ID` (`store_id`),
  KEY `CATALOG_PRODUCT_INDEX_EAV_DECIMAL_VALUE` (`value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Product EAV Decimal Index Table';

--
-- Table structure for table `catalog_product_index_eav_decimal_tmp`
--

CREATE TABLE `catalog_product_index_eav_decimal_tmp` (
  `entity_id` int unsigned NOT NULL COMMENT 'Entity ID',
  `attribute_id` smallint unsigned NOT NULL COMMENT 'Attribute ID',
  `store_id` smallint unsigned NOT NULL COMMENT 'Store ID',
  `value` decimal(12,4) NOT NULL COMMENT 'Value',
  `source_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Original entity ID for attribute value',
  PRIMARY KEY (`entity_id`,`attribute_id`,`store_id`,`value`,`source_id`),
  KEY `CATALOG_PRODUCT_INDEX_EAV_DECIMAL_TMP_ATTRIBUTE_ID` (`attribute_id`),
  KEY `CATALOG_PRODUCT_INDEX_EAV_DECIMAL_TMP_STORE_ID` (`store_id`),
  KEY `CATALOG_PRODUCT_INDEX_EAV_DECIMAL_TMP_VALUE` (`value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Product EAV Decimal Indexer Temp Table';

--
-- Table structure for table `catalog_product_index_eav_idx`
--

CREATE TABLE `catalog_product_index_eav_idx` (
  `entity_id` int unsigned NOT NULL COMMENT 'Entity ID',
  `attribute_id` smallint unsigned NOT NULL COMMENT 'Attribute ID',
  `store_id` smallint unsigned NOT NULL COMMENT 'Store ID',
  `value` int unsigned NOT NULL COMMENT 'Value',
  `source_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Original entity ID for attribute value',
  PRIMARY KEY (`entity_id`,`attribute_id`,`store_id`,`value`,`source_id`),
  KEY `CATALOG_PRODUCT_INDEX_EAV_IDX_ATTRIBUTE_ID` (`attribute_id`),
  KEY `CATALOG_PRODUCT_INDEX_EAV_IDX_STORE_ID` (`store_id`),
  KEY `CATALOG_PRODUCT_INDEX_EAV_IDX_VALUE` (`value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Product EAV Indexer Index Table';

--
-- Table structure for table `catalog_product_index_eav_replica`
--

CREATE TABLE `catalog_product_index_eav_replica` (
  `entity_id` int unsigned NOT NULL COMMENT 'Entity ID',
  `attribute_id` smallint unsigned NOT NULL COMMENT 'Attribute ID',
  `store_id` smallint unsigned NOT NULL COMMENT 'Store ID',
  `value` int unsigned NOT NULL COMMENT 'Value',
  `source_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Original entity ID for attribute value',
  PRIMARY KEY (`entity_id`,`attribute_id`,`store_id`,`value`,`source_id`),
  KEY `CATALOG_PRODUCT_INDEX_EAV_ATTRIBUTE_ID` (`attribute_id`),
  KEY `CATALOG_PRODUCT_INDEX_EAV_STORE_ID` (`store_id`),
  KEY `CATALOG_PRODUCT_INDEX_EAV_VALUE` (`value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Product EAV Index Table';

--
-- Table structure for table `catalog_product_index_eav_tmp`
--

CREATE TABLE `catalog_product_index_eav_tmp` (
  `entity_id` int unsigned NOT NULL COMMENT 'Entity ID',
  `attribute_id` smallint unsigned NOT NULL COMMENT 'Attribute ID',
  `store_id` smallint unsigned NOT NULL COMMENT 'Store ID',
  `value` int unsigned NOT NULL COMMENT 'Value',
  `source_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Original entity ID for attribute value',
  PRIMARY KEY (`entity_id`,`attribute_id`,`store_id`,`value`,`source_id`),
  KEY `CATALOG_PRODUCT_INDEX_EAV_TMP_ATTRIBUTE_ID` (`attribute_id`),
  KEY `CATALOG_PRODUCT_INDEX_EAV_TMP_STORE_ID` (`store_id`),
  KEY `CATALOG_PRODUCT_INDEX_EAV_TMP_VALUE` (`value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Product EAV Indexer Temp Table';

--
-- Table structure for table `catalog_product_index_price`
--

CREATE TABLE `catalog_product_index_price` (
  `entity_id` int unsigned NOT NULL COMMENT 'Entity ID',
  `customer_group_id` int unsigned NOT NULL COMMENT 'Customer Group ID',
  `website_id` smallint unsigned NOT NULL COMMENT 'Website ID',
  `tax_class_id` smallint unsigned DEFAULT '0' COMMENT 'Tax Class ID',
  `price` decimal(20,6) DEFAULT NULL COMMENT 'Price',
  `final_price` decimal(20,6) DEFAULT NULL COMMENT 'Final Price',
  `min_price` decimal(20,6) DEFAULT NULL COMMENT 'Min Price',
  `max_price` decimal(20,6) DEFAULT NULL COMMENT 'Max Price',
  `tier_price` decimal(20,6) DEFAULT NULL COMMENT 'Tier Price',
  PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`),
  KEY `CATALOG_PRODUCT_INDEX_PRICE_CUSTOMER_GROUP_ID` (`customer_group_id`),
  KEY `CATALOG_PRODUCT_INDEX_PRICE_MIN_PRICE` (`min_price`),
  KEY `CAT_PRD_IDX_PRICE_WS_ID_CSTR_GROUP_ID_MIN_PRICE` (`website_id`,`customer_group_id`,`min_price`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Product Price Index Table';

--
-- Table structure for table `catalog_product_index_price_bundle_idx`
--

CREATE TABLE `catalog_product_index_price_bundle_idx` (
  `entity_id` int unsigned NOT NULL COMMENT 'Entity ID',
  `customer_group_id` int NOT NULL,
  `website_id` smallint unsigned NOT NULL COMMENT 'Website ID',
  `tax_class_id` smallint unsigned DEFAULT '0' COMMENT 'Tax Class ID',
  `price_type` smallint unsigned NOT NULL COMMENT 'Price Type',
  `special_price` decimal(20,6) DEFAULT NULL COMMENT 'Special Price',
  `tier_percent` decimal(20,6) DEFAULT NULL COMMENT 'Tier Percent',
  `orig_price` decimal(20,6) DEFAULT NULL COMMENT 'Orig Price',
  `price` decimal(20,6) DEFAULT NULL COMMENT 'Price',
  `min_price` decimal(20,6) DEFAULT NULL COMMENT 'Min Price',
  `max_price` decimal(20,6) DEFAULT NULL COMMENT 'Max Price',
  `tier_price` decimal(20,6) DEFAULT NULL COMMENT 'Tier Price',
  `base_tier` decimal(20,6) DEFAULT NULL COMMENT 'Base Tier',
  PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Product Index Price Bundle Idx';

--
-- Table structure for table `catalog_product_index_price_bundle_opt_idx`
--

CREATE TABLE `catalog_product_index_price_bundle_opt_idx` (
  `entity_id` int unsigned NOT NULL COMMENT 'Entity ID',
  `customer_group_id` int NOT NULL,
  `website_id` smallint unsigned NOT NULL COMMENT 'Website ID',
  `option_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Option ID',
  `min_price` decimal(20,6) DEFAULT NULL COMMENT 'Min Price',
  `alt_price` decimal(20,6) DEFAULT NULL COMMENT 'Alt Price',
  `max_price` decimal(20,6) DEFAULT NULL COMMENT 'Max Price',
  `tier_price` decimal(20,6) DEFAULT NULL COMMENT 'Tier Price',
  `alt_tier_price` decimal(20,6) DEFAULT NULL COMMENT 'Alt Tier Price',
  PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`,`option_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Product Index Price Bundle Opt Idx';

--
-- Table structure for table `catalog_product_index_price_bundle_opt_tmp`
--

CREATE TABLE `catalog_product_index_price_bundle_opt_tmp` (
  `entity_id` int unsigned NOT NULL COMMENT 'Entity ID',
  `customer_group_id` int NOT NULL,
  `website_id` smallint unsigned NOT NULL COMMENT 'Website ID',
  `option_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Option ID',
  `min_price` decimal(20,6) DEFAULT NULL COMMENT 'Min Price',
  `alt_price` decimal(20,6) DEFAULT NULL COMMENT 'Alt Price',
  `max_price` decimal(20,6) DEFAULT NULL COMMENT 'Max Price',
  `tier_price` decimal(20,6) DEFAULT NULL COMMENT 'Tier Price',
  `alt_tier_price` decimal(20,6) DEFAULT NULL COMMENT 'Alt Tier Price',
  PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`,`option_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Product Index Price Bundle Opt Tmp';

--
-- Table structure for table `catalog_product_index_price_bundle_sel_idx`
--

CREATE TABLE `catalog_product_index_price_bundle_sel_idx` (
  `entity_id` int unsigned NOT NULL COMMENT 'Entity ID',
  `customer_group_id` int NOT NULL,
  `website_id` smallint unsigned NOT NULL COMMENT 'Website ID',
  `option_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Option ID',
  `selection_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Selection ID',
  `group_type` smallint unsigned DEFAULT '0' COMMENT 'Group Type',
  `is_required` smallint unsigned DEFAULT '0' COMMENT 'Is Required',
  `price` decimal(20,6) DEFAULT NULL COMMENT 'Price',
  `tier_price` decimal(20,6) DEFAULT NULL COMMENT 'Tier Price',
  PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`,`option_id`,`selection_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Product Index Price Bundle Sel Idx';

--
-- Table structure for table `catalog_product_index_price_bundle_sel_tmp`
--

CREATE TABLE `catalog_product_index_price_bundle_sel_tmp` (
  `entity_id` int unsigned NOT NULL COMMENT 'Entity ID',
  `customer_group_id` int NOT NULL,
  `website_id` smallint unsigned NOT NULL COMMENT 'Website ID',
  `option_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Option ID',
  `selection_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Selection ID',
  `group_type` smallint unsigned DEFAULT '0' COMMENT 'Group Type',
  `is_required` smallint unsigned DEFAULT '0' COMMENT 'Is Required',
  `price` decimal(20,6) DEFAULT NULL COMMENT 'Price',
  `tier_price` decimal(20,6) DEFAULT NULL COMMENT 'Tier Price',
  PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`,`option_id`,`selection_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Product Index Price Bundle Sel Tmp';

--
-- Table structure for table `catalog_product_index_price_bundle_tmp`
--

CREATE TABLE `catalog_product_index_price_bundle_tmp` (
  `entity_id` int unsigned NOT NULL COMMENT 'Entity ID',
  `customer_group_id` int NOT NULL,
  `website_id` smallint unsigned NOT NULL COMMENT 'Website ID',
  `tax_class_id` smallint unsigned DEFAULT '0' COMMENT 'Tax Class ID',
  `price_type` smallint unsigned NOT NULL COMMENT 'Price Type',
  `special_price` decimal(20,6) DEFAULT NULL COMMENT 'Special Price',
  `tier_percent` decimal(20,6) DEFAULT NULL COMMENT 'Tier Percent',
  `orig_price` decimal(20,6) DEFAULT NULL COMMENT 'Orig Price',
  `price` decimal(20,6) DEFAULT NULL COMMENT 'Price',
  `min_price` decimal(20,6) DEFAULT NULL COMMENT 'Min Price',
  `max_price` decimal(20,6) DEFAULT NULL COMMENT 'Max Price',
  `tier_price` decimal(20,6) DEFAULT NULL COMMENT 'Tier Price',
  `base_tier` decimal(20,6) DEFAULT NULL COMMENT 'Base Tier',
  PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Product Index Price Bundle Tmp';

--
-- Table structure for table `catalog_product_index_price_cfg_opt_agr_idx`
--

CREATE TABLE `catalog_product_index_price_cfg_opt_agr_idx` (
  `parent_id` int unsigned NOT NULL COMMENT 'Parent ID',
  `child_id` int unsigned NOT NULL COMMENT 'Child ID',
  `customer_group_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Customer Group ID',
  `website_id` smallint unsigned NOT NULL COMMENT 'Website ID',
  `price` decimal(20,6) DEFAULT NULL COMMENT 'Price',
  `tier_price` decimal(20,6) DEFAULT NULL COMMENT 'Tier Price',
  PRIMARY KEY (`parent_id`,`child_id`,`customer_group_id`,`website_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Product Price Indexer Config Option Aggregate Index Table';

--
-- Table structure for table `catalog_product_index_price_cfg_opt_agr_tmp`
--

CREATE TABLE `catalog_product_index_price_cfg_opt_agr_tmp` (
  `parent_id` int unsigned NOT NULL COMMENT 'Parent ID',
  `child_id` int unsigned NOT NULL COMMENT 'Child ID',
  `customer_group_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Customer Group ID',
  `website_id` smallint unsigned NOT NULL COMMENT 'Website ID',
  `price` decimal(20,6) DEFAULT NULL COMMENT 'Price',
  `tier_price` decimal(20,6) DEFAULT NULL COMMENT 'Tier Price',
  PRIMARY KEY (`parent_id`,`child_id`,`customer_group_id`,`website_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Product Price Indexer Config Option Aggregate Temp Table';

--
-- Table structure for table `catalog_product_index_price_cfg_opt_idx`
--

CREATE TABLE `catalog_product_index_price_cfg_opt_idx` (
  `entity_id` int unsigned NOT NULL COMMENT 'Entity ID',
  `customer_group_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Customer Group ID',
  `website_id` smallint unsigned NOT NULL COMMENT 'Website ID',
  `min_price` decimal(20,6) DEFAULT NULL COMMENT 'Min Price',
  `max_price` decimal(20,6) DEFAULT NULL COMMENT 'Max Price',
  `tier_price` decimal(20,6) DEFAULT NULL COMMENT 'Tier Price',
  PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Product Price Indexer Config Option Index Table';

--
-- Table structure for table `catalog_product_index_price_cfg_opt_tmp`
--

CREATE TABLE `catalog_product_index_price_cfg_opt_tmp` (
  `entity_id` int unsigned NOT NULL COMMENT 'Entity ID',
  `customer_group_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Customer Group ID',
  `website_id` smallint unsigned NOT NULL COMMENT 'Website ID',
  `min_price` decimal(20,6) DEFAULT NULL COMMENT 'Min Price',
  `max_price` decimal(20,6) DEFAULT NULL COMMENT 'Max Price',
  `tier_price` decimal(20,6) DEFAULT NULL COMMENT 'Tier Price',
  PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Product Price Indexer Config Option Temp Table';

--
-- Table structure for table `catalog_product_index_price_downlod_idx`
--

CREATE TABLE `catalog_product_index_price_downlod_idx` (
  `entity_id` int unsigned NOT NULL COMMENT 'Entity ID',
  `customer_group_id` int NOT NULL,
  `website_id` smallint unsigned NOT NULL COMMENT 'Website ID',
  `min_price` decimal(20,6) NOT NULL DEFAULT '0.000000' COMMENT 'Minimum price',
  `max_price` decimal(20,6) NOT NULL DEFAULT '0.000000' COMMENT 'Maximum price',
  PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Indexer Table for price of downloadable products';

--
-- Table structure for table `catalog_product_index_price_downlod_tmp`
--

CREATE TABLE `catalog_product_index_price_downlod_tmp` (
  `entity_id` int unsigned NOT NULL COMMENT 'Entity ID',
  `customer_group_id` int NOT NULL,
  `website_id` smallint unsigned NOT NULL COMMENT 'Website ID',
  `min_price` decimal(20,6) NOT NULL DEFAULT '0.000000' COMMENT 'Minimum price',
  `max_price` decimal(20,6) NOT NULL DEFAULT '0.000000' COMMENT 'Maximum price',
  PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Temporary Indexer Table for price of downloadable products';

--
-- Table structure for table `catalog_product_index_price_final_idx`
--

CREATE TABLE `catalog_product_index_price_final_idx` (
  `entity_id` int unsigned NOT NULL COMMENT 'Entity ID',
  `customer_group_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Customer Group ID',
  `website_id` smallint unsigned NOT NULL COMMENT 'Website ID',
  `tax_class_id` smallint unsigned DEFAULT '0' COMMENT 'Tax Class ID',
  `orig_price` decimal(20,6) DEFAULT NULL COMMENT 'Original Price',
  `price` decimal(20,6) DEFAULT NULL COMMENT 'Price',
  `min_price` decimal(20,6) DEFAULT NULL COMMENT 'Min Price',
  `max_price` decimal(20,6) DEFAULT NULL COMMENT 'Max Price',
  `tier_price` decimal(20,6) DEFAULT NULL COMMENT 'Tier Price',
  `base_tier` decimal(20,6) DEFAULT NULL COMMENT 'Base Tier',
  PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Product Price Indexer Final Index Table';

--
-- Table structure for table `catalog_product_index_price_final_tmp`
--

CREATE TABLE `catalog_product_index_price_final_tmp` (
  `entity_id` int unsigned NOT NULL COMMENT 'Entity ID',
  `customer_group_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Customer Group ID',
  `website_id` smallint unsigned NOT NULL COMMENT 'Website ID',
  `tax_class_id` smallint unsigned DEFAULT '0' COMMENT 'Tax Class ID',
  `orig_price` decimal(20,6) DEFAULT NULL COMMENT 'Original Price',
  `price` decimal(20,6) DEFAULT NULL COMMENT 'Price',
  `min_price` decimal(20,6) DEFAULT NULL COMMENT 'Min Price',
  `max_price` decimal(20,6) DEFAULT NULL COMMENT 'Max Price',
  `tier_price` decimal(20,6) DEFAULT NULL COMMENT 'Tier Price',
  `base_tier` decimal(20,6) DEFAULT NULL COMMENT 'Base Tier',
  PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Product Price Indexer Final Temp Table';

--
-- Table structure for table `catalog_product_index_price_idx`
--

CREATE TABLE `catalog_product_index_price_idx` (
  `entity_id` int unsigned NOT NULL COMMENT 'Entity ID',
  `customer_group_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'Customer Group ID',
  `website_id` smallint unsigned NOT NULL COMMENT 'Website ID',
  `tax_class_id` smallint unsigned DEFAULT '0' COMMENT 'Tax Class ID',
  `price` decimal(20,6) DEFAULT NULL COMMENT 'Price',
  `final_price` decimal(20,6) DEFAULT NULL COMMENT 'Final Price',
  `min_price` decimal(20,6) DEFAULT NULL COMMENT 'Min Price',
  `max_price` decimal(20,6) DEFAULT NULL COMMENT 'Max Price',
  `tier_price` decimal(20,6) DEFAULT NULL COMMENT 'Tier Price',
  PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`),
  KEY `CATALOG_PRODUCT_INDEX_PRICE_IDX_CUSTOMER_GROUP_ID` (`customer_group_id`),
  KEY `CATALOG_PRODUCT_INDEX_PRICE_IDX_WEBSITE_ID` (`website_id`),
  KEY `CATALOG_PRODUCT_INDEX_PRICE_IDX_MIN_PRICE` (`min_price`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Catalog Product Price Indexer Index Table';

--
