-- Хост: localhost
-- Время создания: Сен 25 2018 г., 09:24
-- Версия сервера: 10.3.9-MariaDB-log

START TRANSACTION;






--
-- Структура таблицы `et_delete_log`
--

CREATE TABLE `et_delete_log` (
  `row_id` int(11) NOT NULL,
  `item_type` varchar(80) NOT NULL,
  `item_id` bigint(20) NOT NULL,
  `item_uuid` varchar(80) NOT NULL,
  `deleted_from_site` tinyint(1) NOT NULL,
  `date_add` datetime NOT NULL,
  `user_id` int(11) NOT NULL,
  `item_desc` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Индексы сохранённых таблиц
--

--
-- Индексы таблицы `et_delete_log`
--
ALTER TABLE `et_delete_log`
  ADD PRIMARY KEY (`row_id`),
  ADD KEY `item_type` (`item_type`),
  ADD KEY `item_id` (`item_id`),
  ADD KEY `item_uuid` (`item_uuid`),
  ADD KEY `deleted_from_site` (`deleted_from_site`),
  ADD KEY `user_id` (`user_id`);

--
-- AUTO_INCREMENT для сохранённых таблиц
--

--
-- AUTO_INCREMENT для таблицы `et_delete_log`
--
ALTER TABLE `et_delete_log`
  MODIFY `row_id` int(11) NOT NULL AUTO_INCREMENT;
  
-- --------------------------------------------------------


CREATE TABLE `et_product` (
  `type_id` tinyint(2) NOT NULL DEFAULT 1,
  `product_id` bigint(20) NOT NULL,
  `category_id` bigint(20) NOT NULL,
  `stock_status_id` int(11) NOT NULL,
  `manufacturer_id` int(11) NOT NULL,
  `sku` varchar(255) NOT NULL,
  `price` decimal(19,8) NOT NULL DEFAULT 0.00000000,
  `price_rrp` decimal(19,8) NOT NULL,
  `quantity` int(4) NOT NULL DEFAULT 0,
  `model` varchar(255) NOT NULL,
  `upc` varchar(12) NOT NULL COMMENT 'Universal Product Code',
  `ean` varchar(14) NOT NULL COMMENT 'European Article Number',
  `jan` varchar(13) NOT NULL COMMENT 'Japanese Article Number',
  `isbn` varchar(13) NOT NULL COMMENT 'International Standard Book Number',
  `mpn` varchar(64) NOT NULL COMMENT 'Manufacturer Part Number',
  `stock_location` varchar(128) NOT NULL COMMENT 'Расположение на складе',
  `points` int(8) NOT NULL DEFAULT 0 COMMENT 'Количество зачисляемых баллов при заказе',
  `tax_class_id` int(11) NOT NULL,
  `date_available` date NOT NULL COMMENT 'Дата поступления',
  `warranty` varchar(255) NOT NULL,
  `warranty_class_id` int(11) NOT NULL,
  `weight` decimal(15,8) NOT NULL DEFAULT 0.00000000,
  `weight_class_id` int(11) NOT NULL DEFAULT 0,
  `length` decimal(15,8) NOT NULL DEFAULT 0.00000000,
  `length_class_id` int(11) NOT NULL DEFAULT 0,
  `width` decimal(15,8) NOT NULL DEFAULT 0.00000000,
  `height` decimal(15,8) NOT NULL DEFAULT 0.00000000,
  `subtract_quantity` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'Вычитать со склада',
  `order_minimum` int(11) NOT NULL DEFAULT 1 COMMENT 'Минимальное количество для заказа',
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `status` tinyint(1) NOT NULL DEFAULT 1,
  `date_added` datetime NOT NULL,
  `date_modified` datetime NOT NULL,
  `date_price_update` date NOT NULL,
  `user_id` int(11) NOT NULL,
  `viewed` int(5) NOT NULL DEFAULT 0 COMMENT 'Количество просмотров',
  `price_old` decimal(19,8) DEFAULT NULL,
  `price_cost` decimal(19,8) NOT NULL,
  `delivery_cost` decimal(19,8) DEFAULT NULL,
  `supply_product_id` bigint(20) NOT NULL,
  `contractor_id` int(11) NOT NULL,
  `price_id` int(11) DEFAULT NULL,
  `sheet_id` int(11) DEFAULT NULL,
  `price_row_id` int(11) DEFAULT NULL,
  `uuid` varchar(80) DEFAULT '',
  `uuid_parent` varchar(80) NOT NULL,
  `id_parent` int(11) NOT NULL,
  `profit_value` decimal(19,8) NOT NULL,
  `profit_persent` decimal(12,2) NOT NULL,
  `profit_rrp_persent` decimal(12,2) NOT NULL,
  `profit_rrp_value` decimal(19,8) NOT NULL,
  `flag_xml_export` tinyint(1) DEFAULT 1,
  `flag_popular` smallint(1) NOT NULL,
  `flag_best_deal` smallint(1) NOT NULL,
  `flag_fix_price` tinyint(4) NOT NULL,
  `flag_new_product` tinyint(1) NOT NULL,
  `flag_export` tinyint(1) NOT NULL DEFAULT 1,
  `sku_supply` varchar(255) NOT NULL,
  `ext_url` varchar(255) NOT NULL,
  `product_id_ext` int(11) NOT NULL,
  `sort_data` varchar(40) NOT NULL,
  `row_updated` tinyint(1) NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT 0,
  `flag_exported` tinyint(4) NOT NULL,
  `exist_image` tinyint(1) NOT NULL,
  `exist_video` tinyint(1) NOT NULL,
  `exist_attribute` tinyint(1) NOT NULL,
  `exist_comment` tinyint(1) NOT NULL,
  `price_change_type` tinyint(4) NOT NULL,
  `stock_status_date` date NOT NULL,
  `measure_id` int(11) NOT NULL,
  `product_md5_hash` varchar(32) NOT NULL,
  `_5AF158B44` varchar(255) NOT NULL COMMENT 'ОС',
  `_5AF16087Z` varchar(255) NOT NULL COMMENT 'Разрешение экрана',
  `_5AF160KBR` varchar(255) NOT NULL COMMENT 'Диагональ экрана',
  `_5AF1621GN` varchar(255) NOT NULL COMMENT 'Кол-во ядер',
  `_5AF162KC0` varchar(255) NOT NULL COMMENT 'Новинка'
) ENGINE=InnoDB DEFAULT CHARSET=utf8
PARTITION BY KEY (`type_id`)
PARTITIONS 3;

--
-- Триггеры `et_product`
--
DROP TRIGGER IF EXISTS `before_delete_product`;
DELIMITER $$
CREATE TRIGGER `before_delete_product` BEFORE DELETE ON `et_product` FOR EACH ROW INSERT INTO et_delete_log(item_type, item_id, item_uuid, date_add, item_desc)
							VALUES('product', OLD.product_id, OLD.uuid, NOW(), OLD.sort_data)
$$
DELIMITER ;
DROP TRIGGER IF EXISTS `before_insert_product`;
DELIMITER $$
CREATE TRIGGER `before_insert_product` BEFORE INSERT ON `et_product` FOR EACH ROW IF @TRIGGER_DISABLED IS NULL THEN
								SET new.uuid = UUID(), new.date_added = NOW(); 
							END IF
$$
DELIMITER ;
DROP TRIGGER IF EXISTS `before_update_product`;
DELIMITER $$
CREATE TRIGGER `before_update_product` BEFORE UPDATE ON `et_product` FOR EACH ROW SET NEW.date_modified = NOW()
$$
DELIMITER ;

--
-- Индексы сохранённых таблиц
--

--
-- Индексы таблицы `et_product`
--
ALTER TABLE `et_product`
  ADD PRIMARY KEY (`product_id`,`type_id`),
  ADD KEY `sku` (`sku`),
  ADD KEY `quantity` (`quantity`),
  ADD KEY `stock_status_id` (`stock_status_id`),
  ADD KEY `manufacturer_id` (`manufacturer_id`),
  ADD KEY `price` (`price`),
  ADD KEY `tax_class_id` (`tax_class_id`),
  ADD KEY `weight_class_id` (`weight_class_id`),
  ADD KEY `sort_order` (`sort_order`),
  ADD KEY `status` (`status`),
  ADD KEY `date_added` (`date_added`),
  ADD KEY `date_modified` (`date_modified`),
  ADD KEY `viewed` (`viewed`),
  ADD KEY `supply_id` (`contractor_id`),
  ADD KEY `uuid` (`uuid`),
  ADD KEY `xml_export` (`flag_xml_export`),
  ADD KEY `category_id` (`category_id`),
  ADD KEY `supply_product_id` (`supply_product_id`),
  ADD KEY `sort_data` (`sort_data`),
  ADD KEY `row_updated` (`row_updated`),
  ADD KEY `price_id` (`price_id`) USING BTREE,
  ADD KEY `length_class_id` (`length_class_id`),
  ADD KEY `warranty_class_id` (`warranty_class_id`),
  ADD KEY `flag_fix_price` (`flag_fix_price`),
  ADD KEY `product_id_ext` (`product_id_ext`),
  ADD KEY `deleted` (`deleted`),
  ADD KEY `type_id` (`type_id`),
  ADD KEY `product_id` (`product_id`),
  ADD KEY `uuid_parent` (`uuid_parent`),
  ADD KEY `id_parent` (`id_parent`),
  ADD KEY `flag_export` (`flag_export`),
  ADD KEY `date_price_update` (`date_price_update`),
  ADD KEY `flag_exported` (`flag_exported`),
  ADD KEY `exist_image` (`exist_image`),
  ADD KEY `exist_video` (`exist_video`),
  ADD KEY `exist_attribute` (`exist_attribute`),
  ADD KEY `exist_comment` (`exist_comment`),
  ADD KEY `stock_status_date` (`stock_status_date`),
  ADD KEY `measure_id` (`measure_id`),
  ADD KEY `product_md5_hash` (`product_md5_hash`);

--
-- AUTO_INCREMENT для сохранённых таблиц
--

--
-- AUTO_INCREMENT для таблицы `et_product`
--
ALTER TABLE `et_product`
  MODIFY `product_id` bigint(20) NOT NULL AUTO_INCREMENT;
  
  
CREATE TABLE `et_product_to_category` (
  `product_id` bigint(20) NOT NULL,
  `category_id` bigint(20) NOT NULL,
  `sort_order` int(11) NOT NULL,
  `product_uuid` varchar(80) NOT NULL,
  `category_uuid` varchar(80) NOT NULL,
  `date_added` datetime NOT NULL,
  `date_modified` datetime NOT NULL,
  `user_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Триггеры `et_product_to_category`
--
DROP TRIGGER IF EXISTS `before_insert_product_to_category`;
DELIMITER $$
CREATE TRIGGER `before_insert_product_to_category` BEFORE INSERT ON `et_product_to_category` FOR EACH ROW IF @TRIGGER_DISABLED IS NULL THEN SET new.date_added = NOW(); END IF
$$
DELIMITER ;
DROP TRIGGER IF EXISTS `before_update_product_to_category`;
DELIMITER $$
CREATE TRIGGER `before_update_product_to_category` BEFORE UPDATE ON `et_product_to_category` FOR EACH ROW SET new.date_modified = NOW()
$$
DELIMITER ;

--
-- Индексы сохранённых таблиц
--

--
-- Индексы таблицы `et_product_to_category`
--
ALTER TABLE `et_product_to_category`
  ADD PRIMARY KEY (`product_id`,`category_id`),
  ADD KEY `category_id` (`category_id`),
  ADD KEY `product_id` (`product_id`),
  ADD KEY `sort_order` (`sort_order`),
  ADD KEY `user_id` (`user_id`),
  ADD KEY `product_uuid` (`product_uuid`),
  ADD KEY `category_uuid` (`category_uuid`);
  
--
-- Структура таблицы `et_category_description`
--

CREATE TABLE `et_category_description` (
  `category_id` bigint(20) NOT NULL,
  `language_id` int(11) NOT NULL,
  `name` varchar(255) NOT NULL,
  `description_short` mediumtext NOT NULL,
  `description_full` mediumtext NOT NULL,
  `meta_title` varchar(255) NOT NULL,
  `meta_description` varchar(350) NOT NULL,
  `meta_keyword` varchar(255) NOT NULL,
  `seo_h1` varchar(255) NOT NULL,
  `tag` text NOT NULL,
  `addon_text` varchar(255) NOT NULL,
  `name_full` varchar(500) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8
PARTITION BY KEY (`language_id`)
PARTITIONS 5;

-- --------------------------------------------------------

--
-- Структура таблицы `et_contractor`
--

CREATE TABLE `et_contractor` (
  `contractor_id` int(11) NOT NULL,
  `contractor_group_id` int(11) NOT NULL,
  `status` tinyint(1) NOT NULL DEFAULT 1,
  `contractor_status_id` tinyint(2) NOT NULL,
  `priority` decimal(10,5) NOT NULL DEFAULT 500.00000,
  `priority_value` decimal(19,8) NOT NULL DEFAULT 10000.00000000,
  `name` varchar(255) NOT NULL,
  `image` varchar(255) NOT NULL,
  `image_cloud_url` varchar(255) NOT NULL,
  `address` varchar(255) NOT NULL,
  `address_law` varchar(255) NOT NULL,
  `phones` varchar(255) NOT NULL,
  `url` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `contact_person` text NOT NULL COMMENT 'Контактное лицо',
  `description` varchar(255) NOT NULL,
  `county` varchar(255) NOT NULL,
  `city` varchar(255) NOT NULL,
  `zone` varchar(255) NOT NULL,
  `date_added` datetime NOT NULL,
  `uuid` varchar(80) NOT NULL,
  `sort_order` int(11) NOT NULL COMMENT 'Порядок сортировки',
  `date_modified` date NOT NULL COMMENT 'Дата обновления',
  `user_id` int(11) NOT NULL,
  `color` varchar(10) NOT NULL,
  `rating` int(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Триггеры `et_contractor`
--
DROP TRIGGER IF EXISTS `before_insert_contractor`;
DELIMITER $$
CREATE TRIGGER `before_insert_contractor` BEFORE INSERT ON `et_contractor` FOR EACH ROW IF @TRIGGER_DISABLED IS NULL THEN
							SET new.uuid = UUID(), new.date_added = NOW();
						END IF
$$
DELIMITER ;
DROP TRIGGER IF EXISTS `before_update_contractor`;
DELIMITER $$
CREATE TRIGGER `before_update_contractor` BEFORE UPDATE ON `et_contractor` FOR EACH ROW IF @TRIGGER_DISABLED IS NULL THEN
							SET new.date_modified = NOW();
						END IF
$$
DELIMITER ;

-- --------------------------------------------------------

--
-- Структура таблицы `et_contractor_group`
--

CREATE TABLE `et_contractor_group` (
  `contractor_group_id` int(11) NOT NULL,
  `code` varchar(60) NOT NULL,
  `name` varchar(255) NOT NULL,
  `description` varchar(255) NOT NULL,
  `status` tinyint(1) NOT NULL DEFAULT 1,
  `uuid` varchar(80) NOT NULL,
  `date_added` datetime NOT NULL,
  `color` varchar(10) NOT NULL,
  `image` varchar(255) NOT NULL,
  `date_modified` datetime NOT NULL,
  `user_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Дамп данных таблицы `et_contractor_group`
--

INSERT INTO `et_contractor_group` (`contractor_group_id`, `code`, `name`, `description`, `status`, `uuid`, `date_added`, `color`, `image`, `date_modified`, `user_id`) VALUES
(1, 'supplier', 'Поставщик', '', 1, '5f61d968-3d14-11e5-854d-7a7919af77f8', '2015-08-07 17:55:18', '#a5b9c2', '', '2017-11-19 09:42:20', 0),
(2, 'competitor', 'Конкурент', '', 1, '63b60ce2-3d14-11e5-854d-7a7919af77f8', '2015-08-07 17:55:25', '#b48fcb', '', '2017-11-19 09:42:20', 0),
(3, 'client', 'Клиент', '', 1, 'a4a41643-3d1d-11e5-854d-7a7919af77f8', '2015-08-07 19:01:40', '#7fc981', '', '2017-11-19 09:42:20', 0);

--
-- Триггеры `et_contractor_group`
--
DROP TRIGGER IF EXISTS `before_insert_contractor_group`;
DELIMITER $$
CREATE TRIGGER `before_insert_contractor_group` BEFORE INSERT ON `et_contractor_group` FOR EACH ROW IF @TRIGGER_DISABLED IS NULL THEN SET new.uuid = UUID(), new.date_added = NOW(); END IF
$$
DELIMITER ;
DROP TRIGGER IF EXISTS `before_update_contractor_group`;
DELIMITER $$
CREATE TRIGGER `before_update_contractor_group` BEFORE UPDATE ON `et_contractor_group` FOR EACH ROW SET new.date_modified = NOW()
$$
DELIMITER ;

-- --------------------------------------------------------

--
-- Структура таблицы `et_length_class_description`
--

CREATE TABLE `et_length_class_description` (
  `length_class_id` int(11) NOT NULL,
  `language_id` int(11) NOT NULL,
  `title` varchar(32) NOT NULL,
  `unit` varchar(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Дамп данных таблицы `et_length_class_description`
--

INSERT INTO `et_length_class_description` (`length_class_id`, `language_id`, `title`, `unit`) VALUES
(1, 1, 'Сантиметр', 'см'),
(1, 2, 'Сантиметр', 'см'),
(2, 1, 'Миллиметр', 'мм'),
(2, 2, 'Миллиметр', 'мм');

-- --------------------------------------------------------

--
-- Структура таблицы `et_manufacturer`
--

CREATE TABLE `et_manufacturer` (
  `manufacturer_id` int(11) NOT NULL,
  `name` varchar(64) NOT NULL,
  `image` varchar(255) NOT NULL,
  `image_cloud_url` varchar(255) NOT NULL,
  `sort_order` int(3) NOT NULL,
  `status` tinyint(1) NOT NULL DEFAULT 1,
  `flag_export` tinyint(1) NOT NULL DEFAULT 1,
  `url` varchar(255) NOT NULL,
  `warranty` varchar(255) NOT NULL,
  `uuid` varchar(80) NOT NULL,
  `date_added` datetime NOT NULL,
  `date_modified` datetime NOT NULL,
  `user_id` int(11) NOT NULL,
  `flag_exported` tinyint(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Триггеры `et_manufacturer`
--
DROP TRIGGER IF EXISTS `before_delete_manufacturer`;
DELIMITER $$
CREATE TRIGGER `before_delete_manufacturer` BEFORE DELETE ON `et_manufacturer` FOR EACH ROW INSERT INTO et_delete_log(item_type, item_id, item_uuid, date_add, item_desc)
		VALUES('manufacturer', OLD.manufacturer_id, OLD.uuid, NOW(), OLD.name)
$$
DELIMITER ;
DROP TRIGGER IF EXISTS `before_insert_manufacturer`;
DELIMITER $$
CREATE TRIGGER `before_insert_manufacturer` BEFORE INSERT ON `et_manufacturer` FOR EACH ROW IF @TRIGGER_DISABLED IS NULL THEN SET new.uuid = UUID(), new.date_added = NOW(); END IF
$$
DELIMITER ;
DROP TRIGGER IF EXISTS `before_update_manufacturer`;
DELIMITER $$
CREATE TRIGGER `before_update_manufacturer` BEFORE UPDATE ON `et_manufacturer` FOR EACH ROW SET new.date_modified = NOW()
$$
DELIMITER ;

-- --------------------------------------------------------

--
-- Структура таблицы `et_measure`
--

CREATE TABLE `et_measure` (
  `measure_id` int(11) NOT NULL,
  `status` int(11) NOT NULL DEFAULT 1,
  `code` varchar(60) NOT NULL,
  `unit_name` varchar(60) NOT NULL,
  `unit_name_alias` varchar(60) NOT NULL,
  `type` varchar(60) NOT NULL,
  `is_base_unit` tinyint(1) NOT NULL,
  `koef` decimal(19,8) NOT NULL,
  `uuid` varchar(36) NOT NULL,
  `date_added` datetime NOT NULL,
  `date_modified` datetime NOT NULL,
  `user_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Дамп данных таблицы `et_measure`
--

INSERT INTO `et_measure` (`measure_id`, `status`, `code`, `unit_name`, `unit_name_alias`, `type`, `is_base_unit`, `koef`, `uuid`, `date_added`, `date_modified`, `user_id`) VALUES
(1, 1, '003', 'mm', '', 'length', 0, '0.00100000', 'f0a7eadf-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(2, 1, '004', 'cm', '', 'length', 0, '0.01000000', 'f0a7ec9f-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(3, 1, '006', 'm', '', 'length', 1, '1.00000000', 'f0a7ed15-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(4, 1, '055', 'm2', 'sqm', 'area', 1, '1.00000000', 'f0a7ed74-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(5, 1, '163', 'g', '', 'weight', 0, '0.00000000', 'f0a7edc8-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(6, 1, '166', 'kg', '', 'weight', 0, '0.00000000', 'f0a7ee14-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(7, 1, '168', 't', '', 'weight', 0, '0.00000000', 'f0a7ee60-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(8, 1, '212', 'W', '', 'power', 1, '1.00000000', 'f0a7eea8-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(9, 1, '214', 'kW', '', 'power', 0, '1000.00000000', 'f0a7eef0-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(10, 1, '222', 'V', '', 'power', 0, '0.00000000', 'f0a7ef39-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(11, 1, '283', 'lx', '', 'light', 0, '0.00000000', 'f0a7ef81-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(12, 1, '284', 'lm', '', 'light', 0, '0.00000000', 'f0a7efc9-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(13, 1, '292', 'MHz', '', 'frequency', 0, '1000000.00000000', 'f0a7f011-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(14, 1, '796', 'pc', '', 'econom', 0, '0.00000000', 'f0a7f059-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(15, 1, '778', 'pack', '', 'econom', 0, '0.00000000', 'f0a7f0a5-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(16, 1, '704', 'set', '', 'econom', 0, '0.00000000', 'f0a7f0ee-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(17, 1, '018', 'rm', '', 'econom', 0, '0.00000000', 'f0a7f132-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(18, 1, '257', 'MB', '', 'memory', 1, '1.00000000', 'f0a7f17a-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(19, 1, '258c', 'GB', '', 'memory', 0, '1000.00000000', 'f0a7f1bf-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(20, 1, '293c', 'GHz', '', 'frequency', 0, '1000000000.00000000', 'f0a7f207-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(21, 1, '294c', 'Hz', '', 'frequency', 1, '1.00000000', 'f0a7f253-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(22, 1, '257c', 'KB', '', 'memory', 0, '0.00100000', 'f0a7f29b-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(23, 1, '259c', 'TB', '', 'memory', 0, '1000000.00000000', 'f0a7f2e0-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(24, 1, '039', 'in', '', 'length', 0, '0.02540000', 'f0a7f324-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(25, 1, '041', 'ft', '', 'length', 0, '0.30480000', 'f0a7f36c-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(26, 1, '043', 'yd', '', 'length', 0, '0.91440000', 'f0a7f441-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(27, 1, '008', 'km', '', 'length', 0, '1000.00000000', 'f0a7f540-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(28, 1, '047', 'mi', '', 'length', 0, '1609.00000000', 'f0a7f5c5-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(29, 1, '186', 'lbs', '', 'weight', 0, '0.45360000', 'f0a7f696-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(30, 1, '187', 'oz', '', 'weight', 0, '0.02834950', 'f0a7f70c-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(31, 1, '112', 'L', '', 'volume', 1, '0.00000000', 'f0a7f77e-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(32, 1, '112c', 'ml', '', 'volume', 0, '0.00100000', 'f0a7f7f4-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(33, 1, '113c', 'cm3', '', 'volume', 0, '0.00100000', 'f0a7f86a-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(34, 1, '113', 'm3', '', 'volume', 0, '1000.00000000', 'f0a7f8dc-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(35, 1, '110', 'mm3', '', 'volume', 0, '0.00000100', 'f0a7f94e-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(36, 1, '291', 'KHz', '', 'frequency', 0, '1000.00000000', 'f0a7f9c0-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(37, 1, '291', 'KHz', '', 'frequency', 0, '1000.00000000', 'f0a7fa36-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(38, 1, '215', 'MW', '', 'power', 0, '1000000.00000000', 'f0a7faa8-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(39, 1, '255', 'B', '', 'memory', 0, '0.00000100', 'f0a7fb16-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(40, 1, '354', 'sec', '', 'time', 1, '0.00000100', 'f0a7fb88-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(41, 1, '355', 'min', '', 'time', 0, '60.00000000', 'f0a7fbfe-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(42, 1, '356', 'h', '', 'time', 0, '3600.00000000', 'f0a7fc6c-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(43, 1, '359', 'day', '', 'time', 0, '86400.00000000', 'f0a7fcf5-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(44, 1, '360', 'week', '', 'time', 0, '604800.00000000', 'f0a7fd6b-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(45, 1, '362', 'month', '', 'time', 0, '2592000.00000000', 'f0a7fddd-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(46, 1, '366', 'year', '', 'time', 0, '31536000.00000000', 'f0a7fe53-9aff-11e8-8289-c81f66a9ca2a', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(47, 1, '061', 'km2', 'sqkm', 'area', 0, '1000000.00000000', 'f0a7fe53-9aff-11e8-8289-c81f66a9ca2b', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1),
(48, 1, '051', 'cm2', 'sqcm', 'area', 0, '0.00010000', 'f0a7fe53-9aff-11e8-8289-c81f66a9ca2c', '2018-08-08 16:10:54', '0000-00-00 00:00:00', 1);

-- --------------------------------------------------------

--
-- Структура таблицы `et_measure_description`
--

CREATE TABLE `et_measure_description` (
  `measure_id` int(11) NOT NULL,
  `language_id` int(11) NOT NULL,
  `name` varchar(120) NOT NULL,
  `unit_name_local` varchar(60) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Дамп данных таблицы `et_measure_description`
--

INSERT INTO `et_measure_description` (`measure_id`, `language_id`, `name`, `unit_name_local`) VALUES
(1, 2, 'Миллиметр', 'мм'),
(2, 2, 'Сантиметр', 'см'),
(3, 2, 'Метр', 'м'),
(4, 2, 'Квадратный метр', 'м2'),
(5, 2, 'Грамм', 'г'),
(6, 2, 'Килограмм', 'кг'),
(7, 2, 'Тонна', 'т'),
(8, 2, 'Ватт', 'Вт'),
(9, 2, 'Киловатт', 'кВт'),
(10, 2, 'Вольт', 'В'),
(11, 2, 'Люкс', 'лк'),
(12, 2, 'Люмен', 'лм'),
(13, 2, 'Мегагерц', 'МГц'),
(14, 2, 'Штука', 'шт'),
(15, 2, 'Упаковка', 'упак'),
(16, 2, 'Набор', 'набор'),
(17, 2, 'Погонный метр', 'пог. м'),
(18, 2, 'Мегабайт', 'Мбайт'),
(19, 2, 'Гигабайт', 'Гбайт'),
(20, 2, 'Гигагерц', 'ГГц'),
(21, 2, 'Герц', 'Гц'),
(22, 2, 'Килобайт', 'Кбайт'),
(23, 2, 'Терабайт', 'Тбайт'),
(24, 2, 'Дюйм', 'дюйм'),
(25, 2, 'Фут', 'фут'),
(26, 2, 'Ярд', 'ярд'),
(27, 2, 'Километр', 'км'),
(28, 2, 'Миля', 'миля'),
(29, 2, 'Фунт', 'фунт'),
(30, 2, 'Унция', 'унция'),
(31, 2, 'Литр', 'литр'),
(32, 2, 'Миллилитр', 'миллилитр'),
(33, 2, 'Кубический сантиметр', 'см3'),
(34, 2, 'Кубический метр', 'м3'),
(35, 2, 'Кубический миллиметр', 'мм3'),
(36, 2, 'Килогерц', 'кГц'),
(37, 2, 'Килогерц', 'кГц'),
(38, 2, 'Мегаватт', 'МВт'),
(39, 2, 'Байт', 'байт'),
(40, 2, 'Секунда', 'с'),
(41, 2, 'Минута', 'мин'),
(42, 2, 'Час', 'ч'),
(43, 2, 'Сутки', 'сут'),
(44, 2, 'Неделя', 'нед'),
(45, 2, 'Месяц', 'мес'),
(46, 2, 'Год', 'г'),
(47, 2, 'Квадратный километр', 'км2'),
(48, 2, 'Квадратный сантиметр', 'см2');

-- --------------------------------------------------------

--
-- Структура таблицы `et_product_attribute`
--

CREATE TABLE `et_product_attribute` (
  `row_id` int(11) NOT NULL,
  `product_id` int(11) NOT NULL,
  `attribute_id` int(11) NOT NULL,
  `attribute_block_id` int(11) NOT NULL,
  `language_id` int(11) NOT NULL,
  `attribute_value_id` int(11) NOT NULL,
  `code` varchar(80) NOT NULL,
  `attribute_value` text NOT NULL,
  `value_crc32` int(10) UNSIGNED NOT NULL,
  `attribute_image` text NOT NULL,
  `date_added` datetime NOT NULL,
  `date_modified` datetime NOT NULL,
  `user_id` int(11) NOT NULL,
  `uuid` varchar(80) DEFAULT NULL,
  `flag_exported` tinyint(4) NOT NULL,
  `stock_status_id` int(11) NOT NULL,
  `quantity` int(11) NOT NULL,
  `price` decimal(19,8) NOT NULL,
  `price_prefix` varchar(2) NOT NULL,
  `points` int(11) NOT NULL,
  `points_prefix` varchar(2) NOT NULL,
  `weight` decimal(15,8) NOT NULL,
  `weight_prefix` varchar(2) NOT NULL,
  `sku` varchar(255) NOT NULL,
  `subtract` tinyint(1) NOT NULL,
  `sort_order` int(11) NOT NULL,
  `attribute_color` varchar(8) NOT NULL,
  `measure_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8
PARTITION BY KEY (`attribute_id`)
PARTITIONS 50;

-- --------------------------------------------------------

--
-- Структура таблицы `et_product_description`
--

CREATE TABLE `et_product_description` (
  `product_id` int(11) NOT NULL,
  `language_id` int(11) NOT NULL,
  `name` varchar(255) NOT NULL,
  `description_short` mediumtext NOT NULL,
  `description_full` mediumtext NOT NULL,
  `meta_description` varchar(350) NOT NULL,
  `meta_keyword` varchar(255) NOT NULL,
  `meta_title` varchar(255) NOT NULL,
  `seo_h1` varchar(255) NOT NULL,
  `tag` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8
PARTITION BY KEY (`language_id`)
PARTITIONS 5;

-- --------------------------------------------------------

--
-- Структура таблицы `et_product_image`
--

CREATE TABLE `et_product_image` (
  `product_image_id` int(11) NOT NULL,
  `product_id` int(11) NOT NULL,
  `image` varchar(64) DEFAULT NULL,
  `sort_order` int(3) NOT NULL DEFAULT 0,
  `image_original` varchar(255) NOT NULL,
  `image_cloud_url` varchar(255) NOT NULL,
  `date_added` datetime NOT NULL,
  `date_modified` datetime NOT NULL,
  `user_id` int(11) NOT NULL,
  `uuid` varchar(80) DEFAULT NULL,
  `flag_exported` tinyint(4) NOT NULL,
  `flag_from_site` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Триггеры `et_product_image`
--
DROP TRIGGER IF EXISTS `before_delete_product_image`;
DELIMITER $$
CREATE TRIGGER `before_delete_product_image` BEFORE DELETE ON `et_product_image` FOR EACH ROW INSERT INTO et_delete_log(item_type, item_id, item_uuid, date_add) 
		VALUES('product_image', OLD.product_id, OLD.uuid, NOW())
$$
DELIMITER ;
DROP TRIGGER IF EXISTS `before_insert_product_image`;
DELIMITER $$
CREATE TRIGGER `before_insert_product_image` BEFORE INSERT ON `et_product_image` FOR EACH ROW IF @TRIGGER_DISABLED IS NULL THEN SET new.uuid = UUID(), new.date_added = NOW(); END IF
$$
DELIMITER ;
DROP TRIGGER IF EXISTS `before_update_product_image`;
DELIMITER $$
CREATE TRIGGER `before_update_product_image` BEFORE UPDATE ON `et_product_image` FOR EACH ROW SET new.date_modified = NOW()
$$
DELIMITER ;

-- --------------------------------------------------------

--
-- Структура таблицы `et_selected_item`
--

CREATE TABLE `et_selected_item` (
  `row_id` int(11) NOT NULL,
  `filter_source_type` varchar(80) NOT NULL,
  `filter_type` varchar(80) NOT NULL,
  `key_id` int(11) NOT NULL,
  `item_id` int(11) NOT NULL,
  `item_id_2` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Структура таблицы `et_stock_status`
--

CREATE TABLE `et_stock_status` (
  `stock_status_id` int(11) NOT NULL,
  `flag_in_stock` tinyint(1) NOT NULL,
  `flag_pre_order` tinyint(1) NOT NULL,
  `flag_not_available` tinyint(1) NOT NULL,
  `flag_other` tinyint(1) NOT NULL,
  `quantity` int(4) NOT NULL,
  `status_detect_default_list` text NOT NULL,
  `search_entering` tinyint(1) NOT NULL,
  `flag_detect_quantity` tinyint(1) NOT NULL DEFAULT 1,
  `image` varchar(255) NOT NULL,
  `image_cloud_url` varchar(255) NOT NULL,
  `color` varchar(20) NOT NULL,
  `date_added` datetime NOT NULL,
  `date_modified` datetime NOT NULL,
  `user_id` int(11) NOT NULL,
  `uuid` varchar(80) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Дамп данных таблицы `et_stock_status`
--

INSERT INTO `et_stock_status` (`stock_status_id`, `flag_in_stock`, `flag_pre_order`, `flag_not_available`, `flag_other`, `quantity`, `status_detect_default_list`, `search_entering`, `flag_detect_quantity`, `image`, `image_cloud_url`, `color`, `date_added`, `date_modified`, `user_id`, `uuid`) VALUES
(5, 0, 0, 1, 0, 0, 'нет;-;false;0;', 0, 1, 'bullet_red.png', '', '#DD2560', '0000-00-00 00:00:00', '2017-11-19 09:42:08', 0, '063eb9a0-53dc-11e6-99de-005056c00008'),
(6, 0, 0, 0, 1, 0, 'в пути; транзит;', 0, 1, 'bullet_purple.png', '', '#8e44ad', '0000-00-00 00:00:00', '2016-07-27 12:23:14', 0, '063ebab9-53dc-11e6-99de-005056c00008'),
(7, 1, 0, 0, 0, 100, 'есть; много; мало; более; *; +; •; >;true', 0, 1, 'bullet_green.png', '', '#29B865', '0000-00-00 00:00:00', '2018-09-19 20:11:27', 0, '063ebbb8-53dc-11e6-99de-005056c00008'),
(8, 0, 1, 0, 0, 0, 'под заказ; ', 0, 1, 'bullet_blue.png', '', '#2980b9', '0000-00-00 00:00:00', '2016-07-27 12:23:14', 0, '063eb7b5-53dc-11e6-99de-005056c00008');

--
-- Триггеры `et_stock_status`
--
DROP TRIGGER IF EXISTS `before_insert_stock_status`;
DELIMITER $$
CREATE TRIGGER `before_insert_stock_status` BEFORE INSERT ON `et_stock_status` FOR EACH ROW IF @TRIGGER_DISABLED IS NULL THEN SET new.uuid = UUID(), new.date_added = NOW(); END IF
$$
DELIMITER ;
DROP TRIGGER IF EXISTS `before_update_stock_status`;
DELIMITER $$
CREATE TRIGGER `before_update_stock_status` BEFORE UPDATE ON `et_stock_status` FOR EACH ROW SET new.date_modified = NOW()
$$
DELIMITER ;

-- --------------------------------------------------------

--
-- Структура таблицы `et_stock_status_description`
--

CREATE TABLE `et_stock_status_description` (
  `stock_status_id` int(11) NOT NULL,
  `language_id` int(11) NOT NULL,
  `name` varchar(255) NOT NULL,
  `description` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Дамп данных таблицы `et_stock_status_description`
--

INSERT INTO `et_stock_status_description` (`stock_status_id`, `language_id`, `name`, `description`) VALUES
(5, 1, 'Нет в наличии', ''),
(5, 2, 'Нет в наличии', ''),
(6, 1, 'Ожидание 2-3 дня', ''),
(6, 2, 'Ожидание 2-3 дня', ''),
(7, 1, 'В наличии', ''),
(7, 2, 'В наличии', ''),
(8, 1, 'Предзаказ', ''),
(8, 2, 'Предзаказ', '');



--
-- Структура таблицы `et_url_alias`
--

CREATE TABLE `et_url_alias` (
  `url_alias_id` int(11) NOT NULL,
  `store_id` int(11) NOT NULL,
  `language_id` int(11) NOT NULL,
  `filter_category_id` int(20) NOT NULL,
  `status` int(11) NOT NULL DEFAULT 1,
  `query` varchar(255) NOT NULL,
  `keyword` varchar(255) NOT NULL,
  `item_type` varchar(40) NOT NULL,
  `item_id` int(11) NOT NULL,
  `push` varchar(255) NOT NULL,
  `seo_h1` varchar(255) NOT NULL,
  `description_short` mediumtext NOT NULL,
  `description_full` mediumtext NOT NULL,
  `meta_description` varchar(350) NOT NULL,
  `meta_keyword` varchar(255) NOT NULL,
  `meta_title` varchar(255) NOT NULL,
  `tag` text NOT NULL,
  `date_added` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



-- --------------------------------------------------------

--
-- Структура таблицы `et_warranty_class_description`
--

CREATE TABLE `et_warranty_class_description` (
  `warranty_class_id` int(11) NOT NULL,
  `language_id` int(11) NOT NULL,
  `title` varchar(30) NOT NULL,
  `unit` varchar(30) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Структура таблицы `et_weight_class_description`
--

CREATE TABLE `et_weight_class_description` (
  `weight_class_id` int(11) NOT NULL,
  `language_id` int(11) NOT NULL,
  `title` varchar(32) NOT NULL,
  `unit` varchar(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Дамп данных таблицы `et_weight_class_description`
--

INSERT INTO `et_weight_class_description` (`weight_class_id`, `language_id`, `title`, `unit`) VALUES
(1, 1, 'Килограмм', 'кг'),
(1, 2, 'Килограмм', 'кг'),
(2, 1, 'Грамм', 'г'),
(2, 2, 'Грамм', 'г');

--
-- Индексы сохранённых таблиц
--

--
-- Индексы таблицы `et_url_alias`
--
ALTER TABLE `et_url_alias`
  ADD PRIMARY KEY (`url_alias_id`),
  ADD KEY `keyword` (`keyword`),
  ADD KEY `item_id` (`item_id`),
  ADD KEY `item_type` (`item_type`),
  ADD KEY `store_id` (`store_id`),
  ADD KEY `language_id` (`language_id`),
  ADD KEY `filter_category_id` (`filter_category_id`),
  ADD KEY `status` (`status`);

--
-- Индексы таблицы `et_warranty_class_description`
--
ALTER TABLE `et_warranty_class_description`
  ADD PRIMARY KEY (`warranty_class_id`),
  ADD KEY `language_id` (`language_id`);

--
-- Индексы таблицы `et_weight_class_description`
--
ALTER TABLE `et_weight_class_description`
  ADD PRIMARY KEY (`weight_class_id`,`language_id`);

--
-- AUTO_INCREMENT для сохранённых таблиц
--

--
-- AUTO_INCREMENT для таблицы `et_url_alias`
--
ALTER TABLE `et_url_alias`
  MODIFY `url_alias_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8221;

--
-- AUTO_INCREMENT для таблицы `et_warranty_class_description`
--
ALTER TABLE `et_warranty_class_description`
  MODIFY `warranty_class_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT для таблицы `et_weight_class_description`
--
ALTER TABLE `et_weight_class_description`
  MODIFY `weight_class_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;


--
-- Индексы сохранённых таблиц
--

--
-- Индексы таблицы `et_category_description`
--
ALTER TABLE `et_category_description`
  ADD PRIMARY KEY (`category_id`,`language_id`),
  ADD KEY `name` (`name`),
  ADD KEY `name_full` (`name_full`(333));

--
-- Индексы таблицы `et_contractor`
--
ALTER TABLE `et_contractor`
  ADD PRIMARY KEY (`contractor_id`),
  ADD KEY `supply_type_id` (`contractor_group_id`),
  ADD KEY `name` (`name`),
  ADD KEY `supply_uuid` (`uuid`),
  ADD KEY `sort_order` (`sort_order`),
  ADD KEY `status` (`status`),
  ADD KEY `user_id` (`user_id`),
  ADD KEY `contractor_status_id` (`contractor_status_id`);

--
-- Индексы таблицы `et_contractor_group`
--
ALTER TABLE `et_contractor_group`
  ADD PRIMARY KEY (`contractor_group_id`),
  ADD KEY `name` (`name`),
  ADD KEY `status` (`status`),
  ADD KEY `uuid` (`uuid`),
  ADD KEY `user_id` (`user_id`);

--
-- Индексы таблицы `et_length_class_description`
--
ALTER TABLE `et_length_class_description`
  ADD PRIMARY KEY (`length_class_id`,`language_id`),
  ADD KEY `title` (`title`),
  ADD KEY `unit` (`unit`);

--
-- Индексы таблицы `et_manufacturer`
--
ALTER TABLE `et_manufacturer`
  ADD PRIMARY KEY (`manufacturer_id`),
  ADD KEY `name` (`name`),
  ADD KEY `sort_order` (`sort_order`),
  ADD KEY `uuid` (`uuid`),
  ADD KEY `status` (`status`),
  ADD KEY `user_id` (`user_id`),
  ADD KEY `flag_export` (`flag_export`),
  ADD KEY `flag_exported` (`flag_exported`);

--
-- Индексы таблицы `et_measure`
--
ALTER TABLE `et_measure`
  ADD PRIMARY KEY (`measure_id`),
  ADD KEY `status` (`status`),
  ADD KEY `uuid` (`uuid`),
  ADD KEY `is_base_unit` (`is_base_unit`),
  ADD KEY `unit_name` (`unit_name`),
  ADD KEY `type` (`type`),
  ADD KEY `unit_name_alias` (`unit_name_alias`);

--
-- Индексы таблицы `et_measure_description`
--
ALTER TABLE `et_measure_description`
  ADD PRIMARY KEY (`measure_id`,`language_id`),
  ADD KEY `unit_name_local` (`unit_name_local`);

--
-- Индексы таблицы `et_product_attribute`
--
ALTER TABLE `et_product_attribute`
  ADD PRIMARY KEY (`row_id`,`attribute_id`),
  ADD KEY `attribute_id` (`attribute_id`),
  ADD KEY `language_id` (`language_id`),
  ADD KEY `user_id` (`user_id`),
  ADD KEY `flag_exported` (`flag_exported`),
  ADD KEY `attribute_block_id` (`attribute_block_id`),
  ADD KEY `product_id` (`product_id`),
  ADD KEY `attribute_value_id` (`attribute_value_id`),
  ADD KEY `code` (`code`),
  ADD KEY `value_crc32` (`value_crc32`),
  ADD KEY `sort_order` (`sort_order`);

--
-- Индексы таблицы `et_product_description`
--
ALTER TABLE `et_product_description`
  ADD PRIMARY KEY (`product_id`,`language_id`),
  ADD KEY `language_id` (`language_id`),
  ADD KEY `name` (`name`);

--
-- Индексы таблицы `et_product_image`
--
ALTER TABLE `et_product_image`
  ADD PRIMARY KEY (`product_image_id`),
  ADD KEY `product_id` (`product_id`),
  ADD KEY `sort_order` (`sort_order`),
  ADD KEY `image_original` (`image_original`),
  ADD KEY `user_id` (`user_id`),
  ADD KEY `image` (`image`),
  ADD KEY `flag_exported` (`flag_exported`),
  ADD KEY `uuid` (`uuid`);

--
-- Индексы таблицы `et_selected_item`
--
ALTER TABLE `et_selected_item`
  ADD PRIMARY KEY (`row_id`),
  ADD KEY `filter_type` (`filter_type`),
  ADD KEY `key_id` (`key_id`),
  ADD KEY `item_id` (`item_id`),
  ADD KEY `filter_source_type` (`filter_source_type`),
  ADD KEY `item_id_2` (`item_id_2`);

--
-- Индексы таблицы `et_stock_status`
--
ALTER TABLE `et_stock_status`
  ADD PRIMARY KEY (`stock_status_id`),
  ADD KEY `flag_in_stock` (`flag_in_stock`),
  ADD KEY `flag_pre_order` (`flag_pre_order`),
  ADD KEY `flag_not_available` (`flag_not_available`),
  ADD KEY `user_id` (`user_id`),
  ADD KEY `uuid` (`uuid`);

--
-- Индексы таблицы `et_stock_status_description`
--
ALTER TABLE `et_stock_status_description`
  ADD PRIMARY KEY (`stock_status_id`,`language_id`),
  ADD KEY `name` (`name`);

--
-- AUTO_INCREMENT для сохранённых таблиц
--

--
-- AUTO_INCREMENT для таблицы `et_contractor`
--
ALTER TABLE `et_contractor`
  MODIFY `contractor_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT для таблицы `et_contractor_group`
--
ALTER TABLE `et_contractor_group`
  MODIFY `contractor_group_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT для таблицы `et_length_class_description`
--
ALTER TABLE `et_length_class_description`
  MODIFY `length_class_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT для таблицы `et_manufacturer`
--
ALTER TABLE `et_manufacturer`
  MODIFY `manufacturer_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT для таблицы `et_measure`
--
ALTER TABLE `et_measure`
  MODIFY `measure_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=49;

--
-- AUTO_INCREMENT для таблицы `et_product_attribute`
--
ALTER TABLE `et_product_attribute`
  MODIFY `row_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT для таблицы `et_product_image`
--
ALTER TABLE `et_product_image`
  MODIFY `product_image_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT для таблицы `et_selected_item`
--
ALTER TABLE `et_selected_item`
  MODIFY `row_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT для таблицы `et_stock_status`
--
ALTER TABLE `et_stock_status`
  MODIFY `stock_status_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=40;
COMMIT;

