1SET SESSION sql_mode = '';
2SET NAMES 'utf8mb4';
3
4CREATE TABLE `PREFIX_access` (
5  `id_profile` INT(11) UNSIGNED NOT NULL,
6  `id_tab`     INT(11) UNSIGNED NOT NULL,
7  `view`       INT(11)          NOT NULL,
8  `add`        INT(11)          NOT NULL,
9  `edit`       INT(11)          NOT NULL,
10  `delete`     INT(11)          NOT NULL,
11  PRIMARY KEY (`id_profile`, `id_tab`)
12)
13  ENGINE = InnoDB
14  DEFAULT CHARSET = utf8mb4
15  DEFAULT COLLATE utf8mb4_unicode_ci;
16
17CREATE TABLE `PREFIX_accessory` (
18  `id_product_1` INT(11) UNSIGNED NOT NULL,
19  `id_product_2` INT(11) UNSIGNED NOT NULL,
20  KEY `accessory_product` (`id_product_1`, `id_product_2`)
21)
22  ENGINE = InnoDB
23  DEFAULT CHARSET = utf8mb4
24  DEFAULT COLLATE utf8mb4_unicode_ci;
25
26CREATE TABLE `PREFIX_address` (
27  `id_address`      INT(11) UNSIGNED    NOT NULL AUTO_INCREMENT,
28  `id_country`      INT(11) UNSIGNED    NOT NULL,
29  `id_state`        INT(11) UNSIGNED             DEFAULT NULL,
30  `id_customer`     INT(11) UNSIGNED    NOT NULL DEFAULT '0',
31  `id_manufacturer` INT(11) UNSIGNED    NOT NULL DEFAULT '0',
32  `id_supplier`     INT(11) UNSIGNED    NOT NULL DEFAULT '0',
33  `id_warehouse`    INT(11) UNSIGNED    NOT NULL DEFAULT '0',
34  `alias`           VARCHAR(32)         NOT NULL,
35  `company`         VARCHAR(64)                  DEFAULT NULL,
36  `lastname`        VARCHAR(32)         NOT NULL,
37  `firstname`       VARCHAR(32)         NOT NULL,
38  `address1`        VARCHAR(128)        NOT NULL,
39  `address2`        VARCHAR(128)                 DEFAULT NULL,
40  `postcode`        VARCHAR(12)                  DEFAULT NULL,
41  `city`            VARCHAR(64)         NOT NULL,
42  `other`           TEXT,
43  `phone`           VARCHAR(32)                  DEFAULT NULL,
44  `phone_mobile`    VARCHAR(32)                  DEFAULT NULL,
45  `vat_number`      VARCHAR(32)                  DEFAULT NULL,
46  `dni`             VARCHAR(16)                  DEFAULT NULL,
47  `date_add`        DATETIME            NOT NULL,
48  `date_upd`        DATETIME            NOT NULL,
49  `active`          TINYINT(1) UNSIGNED NOT NULL DEFAULT '1',
50  `deleted`         TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
51  PRIMARY KEY (`id_address`),
52  KEY `address_customer` (`id_customer`),
53  KEY `id_country` (`id_country`),
54  KEY `id_state` (`id_state`),
55  KEY `id_manufacturer` (`id_manufacturer`),
56  KEY `id_supplier` (`id_supplier`),
57  KEY `id_warehouse` (`id_warehouse`)
58)
59  ENGINE = InnoDB
60  DEFAULT CHARSET = utf8mb4
61  DEFAULT COLLATE utf8mb4_unicode_ci;
62
63CREATE TABLE `PREFIX_alias` (
64  `id_alias` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
65  `alias`    VARCHAR(64)      NOT NULL,
66  `search`   VARCHAR(255)     NOT NULL,
67  `active`   TINYINT(1)       NOT NULL DEFAULT '1',
68  PRIMARY KEY (`id_alias`),
69  UNIQUE KEY `alias` (`alias`)
70)
71  ENGINE = InnoDB
72  DEFAULT CHARSET = utf8mb4
73  DEFAULT COLLATE utf8mb4_unicode_ci;
74
75CREATE TABLE `PREFIX_attachment` (
76  `id_attachment` INT(11) UNSIGNED    NOT NULL AUTO_INCREMENT,
77  `file`          VARCHAR(40)         NOT NULL,
78  `file_name`     VARCHAR(128)        NOT NULL,
79  `file_size`     BIGINT(11) UNSIGNED NOT NULL DEFAULT '0',
80  `mime`          VARCHAR(128)        NOT NULL,
81  PRIMARY KEY (`id_attachment`)
82)
83  ENGINE = InnoDB
84  DEFAULT CHARSET = utf8mb4
85  DEFAULT COLLATE utf8mb4_unicode_ci;
86
87CREATE TABLE `PREFIX_attachment_lang` (
88  `id_attachment` INT(11) UNSIGNED NOT NULL,
89  `id_lang`       INT(11) UNSIGNED NOT NULL,
90  `name`          VARCHAR(32)               DEFAULT NULL,
91  `description`   TEXT,
92  PRIMARY KEY (`id_attachment`, `id_lang`)
93)
94  ENGINE = InnoDB
95  DEFAULT CHARSET = utf8mb4
96  DEFAULT COLLATE utf8mb4_unicode_ci;
97
98CREATE TABLE `PREFIX_product_attachment` (
99  `id_product`    INT(11) UNSIGNED NOT NULL,
100  `id_attachment` INT(11) UNSIGNED NOT NULL,
101  PRIMARY KEY (`id_product`, `id_attachment`)
102)
103  ENGINE = InnoDB
104  DEFAULT CHARSET = utf8mb4
105  DEFAULT COLLATE utf8mb4_unicode_ci;
106
107CREATE TABLE `PREFIX_attribute` (
108  `id_attribute`       INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
109  `id_attribute_group` INT(11) UNSIGNED NOT NULL,
110  `color`              VARCHAR(32)               DEFAULT NULL,
111  `position`           INT(11) UNSIGNED NOT NULL DEFAULT '0',
112  PRIMARY KEY (`id_attribute`),
113  KEY `attribute_group` (`id_attribute_group`)
114)
115  ENGINE = InnoDB
116  DEFAULT CHARSET = utf8mb4
117  DEFAULT COLLATE utf8mb4_unicode_ci;
118
119CREATE TABLE `PREFIX_attribute_group` (
120  `id_attribute_group` INT(11) UNSIGNED                  NOT NULL AUTO_INCREMENT,
121  `is_color_group`     TINYINT(1)                        NOT NULL DEFAULT '0',
122  `group_type`         ENUM ('select', 'radio', 'color') NOT NULL DEFAULT 'select',
123  `position`           INT(11) UNSIGNED                  NOT NULL DEFAULT '0',
124  PRIMARY KEY (`id_attribute_group`)
125)
126  ENGINE = InnoDB
127  DEFAULT CHARSET = utf8mb4
128  DEFAULT COLLATE utf8mb4_unicode_ci;
129
130CREATE TABLE `PREFIX_attribute_group_lang` (
131  `id_attribute_group` INT(11) UNSIGNED NOT NULL,
132  `id_lang`            INT(11) UNSIGNED NOT NULL,
133  `name`               VARCHAR(128)     NOT NULL,
134  `public_name`        VARCHAR(64)      NOT NULL,
135  PRIMARY KEY (`id_attribute_group`, `id_lang`)
136)
137  ENGINE = InnoDB
138  DEFAULT CHARSET = utf8mb4
139  DEFAULT COLLATE utf8mb4_unicode_ci;
140
141CREATE TABLE `PREFIX_attribute_impact` (
142  `id_attribute_impact` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
143  `id_product`          INT(11) UNSIGNED NOT NULL,
144  `id_attribute`        INT(11) UNSIGNED NOT NULL,
145  `weight`              DECIMAL(20, 6)   NOT NULL,
146  `price`               DECIMAL(20, 6)   NOT NULL,
147  PRIMARY KEY (`id_attribute_impact`),
148  UNIQUE KEY `id_product` (`id_product`, `id_attribute`)
149)
150  ENGINE = InnoDB
151  DEFAULT CHARSET = utf8mb4
152  DEFAULT COLLATE utf8mb4_unicode_ci;
153
154CREATE TABLE `PREFIX_attribute_lang` (
155  `id_attribute` INT(11) UNSIGNED NOT NULL,
156  `id_lang`      INT(11) UNSIGNED NOT NULL,
157  `name`         VARCHAR(128)     NOT NULL,
158  PRIMARY KEY (`id_attribute`, `id_lang`),
159  KEY `id_lang` (`id_lang`, `name`)
160)
161  ENGINE = InnoDB
162  DEFAULT CHARSET = utf8mb4
163  DEFAULT COLLATE utf8mb4_unicode_ci;
164
165CREATE TABLE `PREFIX_carrier` (
166  `id_carrier`           INT(11) UNSIGNED    NOT NULL AUTO_INCREMENT,
167  `id_reference`         INT(11) UNSIGNED    NOT NULL,
168  `id_tax_rules_group`   INT(11) UNSIGNED             DEFAULT '0',
169  `name`                 VARCHAR(64)         NOT NULL,
170  `url`                  VARCHAR(255)                 DEFAULT NULL,
171  `active`               TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
172  `deleted`              TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
173  `shipping_handling`    TINYINT(1) UNSIGNED NOT NULL DEFAULT '1',
174  `range_behavior`       TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
175  `is_module`            TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
176  `is_free`              TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
177  `shipping_external`    TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
178  `need_range`           TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
179  `external_module_name` VARCHAR(64)                  DEFAULT NULL,
180  `shipping_method`      INT(2)              NOT NULL DEFAULT '0',
181  `position`             INT(11) UNSIGNED    NOT NULL DEFAULT '0',
182  `max_width`            INT(10)                      DEFAULT '0',
183  `max_height`           INT(10)                      DEFAULT '0',
184  `max_depth`            INT(10)                      DEFAULT '0',
185  `max_weight`           DECIMAL(20, 6)               DEFAULT 0,
186  `grade`                INT(10)                      DEFAULT '0',
187  PRIMARY KEY (`id_carrier`),
188  KEY `deleted` (`deleted`, `active`),
189  KEY `id_tax_rules_group` (`id_tax_rules_group`),
190  KEY `reference` (`id_reference`, `deleted`, `active`)
191)
192  ENGINE = InnoDB
193  DEFAULT CHARSET = utf8mb4
194  DEFAULT COLLATE utf8mb4_unicode_ci;
195
196CREATE TABLE `PREFIX_carrier_lang` (
197  `id_carrier` INT(11) UNSIGNED NOT NULL,
198  `id_shop`    INT(11) UNSIGNED NOT NULL DEFAULT '1',
199  `id_lang`    INT(11) UNSIGNED NOT NULL,
200  `delay`      VARCHAR(128)              DEFAULT NULL,
201  PRIMARY KEY (`id_lang`, `id_shop`, `id_carrier`)
202)
203  ENGINE = InnoDB
204  DEFAULT CHARSET = utf8mb4
205  DEFAULT COLLATE utf8mb4_unicode_ci;
206
207CREATE TABLE `PREFIX_carrier_zone` (
208  `id_carrier` INT(11) UNSIGNED NOT NULL,
209  `id_zone`    INT(11) UNSIGNED NOT NULL,
210  PRIMARY KEY (`id_carrier`, `id_zone`)
211)
212  ENGINE = InnoDB
213  DEFAULT CHARSET = utf8mb4
214  DEFAULT COLLATE utf8mb4_unicode_ci;
215
216CREATE TABLE `PREFIX_cart` (
217  `id_cart`                 INT(11) UNSIGNED    NOT NULL AUTO_INCREMENT,
218  `id_shop_group`           INT(11) UNSIGNED    NOT NULL DEFAULT '1',
219  `id_shop`                 INT(11) UNSIGNED    NOT NULL DEFAULT '1',
220  `id_carrier`              INT(11) UNSIGNED    NOT NULL,
221  `delivery_option`         TEXT                NOT NULL,
222  `id_lang`                 INT(11) UNSIGNED    NOT NULL,
223  `id_address_delivery`     INT(11) UNSIGNED    NOT NULL,
224  `id_address_invoice`      INT(11) UNSIGNED    NOT NULL,
225  `id_currency`             INT(11) UNSIGNED    NOT NULL,
226  `id_customer`             INT(11) UNSIGNED    NOT NULL,
227  `id_guest`                INT(11) UNSIGNED    NOT NULL,
228  `secure_key`              VARCHAR(32)         NOT NULL DEFAULT '-1',
229  `recyclable`              TINYINT(1) UNSIGNED NOT NULL DEFAULT '1',
230  `gift`                    TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
231  `gift_message`            TEXT,
232  `mobile_theme`            TINYINT(1)          NOT NULL DEFAULT '0',
233  `allow_seperated_package` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
234  `date_add`                DATETIME            NOT NULL,
235  `date_upd`                DATETIME            NOT NULL,
236  PRIMARY KEY (`id_cart`),
237  KEY `cart_customer` (`id_customer`),
238  KEY `id_address_delivery` (`id_address_delivery`),
239  KEY `id_address_invoice` (`id_address_invoice`),
240  KEY `id_carrier` (`id_carrier`),
241  KEY `id_lang` (`id_lang`),
242  KEY `id_currency` (`id_currency`),
243  KEY `id_guest` (`id_guest`),
244  KEY `id_shop_group` (`id_shop_group`),
245  KEY `id_shop_2` (`id_shop`, `date_upd`),
246  KEY `id_shop` (`id_shop`, `date_add`)
247)
248  ENGINE = InnoDB
249  DEFAULT CHARSET = utf8mb4
250  DEFAULT COLLATE utf8mb4_unicode_ci;
251
252CREATE TABLE `PREFIX_cart_rule` (
253  `id_cart_rule`            INT(11) UNSIGNED    NOT NULL AUTO_INCREMENT,
254  `id_customer`             INT UNSIGNED        NOT NULL DEFAULT '0',
255  `date_from`               DATETIME            NOT NULL,
256  `date_to`                 DATETIME            NOT NULL,
257  `description`             TEXT,
258  `quantity`                INT(11) UNSIGNED    NOT NULL DEFAULT '0',
259  `quantity_per_user`       INT(11) UNSIGNED    NOT NULL DEFAULT '0',
260  `priority`                INT(11) UNSIGNED    NOT NULL DEFAULT 1,
261  `partial_use`             TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
262  `code`                    VARCHAR(254)        NOT NULL,
263  `minimum_amount`          DECIMAL(20, 6)      NOT NULL DEFAULT 0,
264  `minimum_amount_tax`      TINYINT(1)          NOT NULL DEFAULT '0',
265  `minimum_amount_currency` INT UNSIGNED        NOT NULL DEFAULT '0',
266  `minimum_amount_shipping` TINYINT(1)          NOT NULL DEFAULT '0',
267  `country_restriction`     TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
268  `carrier_restriction`     TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
269  `group_restriction`       TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
270  `cart_rule_restriction`   TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
271  `product_restriction`     TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
272  `shop_restriction`        TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
273  `free_shipping`           TINYINT(1)          NOT NULL DEFAULT '0',
274  `reduction_percent`       DECIMAL(5, 2)       NOT NULL DEFAULT 0,
275  `reduction_amount`        DECIMAL(20, 6)      NOT NULL DEFAULT 0,
276  `reduction_tax`           TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
277  `reduction_currency`      INT(11) UNSIGNED    NOT NULL DEFAULT '0',
278  `reduction_product`       INT(10)             NOT NULL DEFAULT '0',
279  `gift_product`            INT(11) UNSIGNED    NOT NULL DEFAULT '0',
280  `gift_product_attribute`  INT(11) UNSIGNED    NOT NULL DEFAULT '0',
281  `highlight`               TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
282  `active`                  TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
283  `date_add`                DATETIME            NOT NULL,
284  `date_upd`                DATETIME            NOT NULL,
285  PRIMARY KEY (`id_cart_rule`),
286  KEY `id_customer` (`id_customer`, `active`, `date_to`),
287  KEY `group_restriction` (`group_restriction`, `active`, `date_to`),
288  KEY `id_customer_2` (`id_customer`, `active`, `highlight`, `date_to`),
289  KEY `group_restriction_2` (`group_restriction`, `active`, `highlight`, `date_to`)
290)
291  ENGINE = InnoDB
292  DEFAULT CHARSET = utf8mb4
293  DEFAULT COLLATE utf8mb4_unicode_ci;
294
295CREATE TABLE `PREFIX_cart_rule_lang` (
296  `id_cart_rule` INT(11) UNSIGNED NOT NULL,
297  `id_lang`      INT(11) UNSIGNED NOT NULL,
298  `name`         VARCHAR(254)     NOT NULL,
299  PRIMARY KEY (`id_cart_rule`, `id_lang`)
300)
301  ENGINE = InnoDB
302  DEFAULT CHARSET = utf8mb4
303  DEFAULT COLLATE utf8mb4_unicode_ci;
304
305CREATE TABLE `PREFIX_cart_rule_country` (
306  `id_cart_rule` INT(11) UNSIGNED NOT NULL,
307  `id_country`   INT(11) UNSIGNED NOT NULL,
308  PRIMARY KEY (`id_cart_rule`, `id_country`)
309)
310  ENGINE = InnoDB
311  DEFAULT CHARSET = utf8mb4
312  DEFAULT COLLATE utf8mb4_unicode_ci;
313
314CREATE TABLE `PREFIX_cart_rule_group` (
315  `id_cart_rule` INT(11) UNSIGNED NOT NULL,
316  `id_group`     INT(11) UNSIGNED NOT NULL,
317  PRIMARY KEY (`id_cart_rule`, `id_group`)
318)
319  ENGINE = InnoDB
320  DEFAULT CHARSET = utf8mb4
321  DEFAULT COLLATE utf8mb4_unicode_ci;
322
323CREATE TABLE `PREFIX_cart_rule_carrier` (
324  `id_cart_rule` INT(11) UNSIGNED NOT NULL,
325  `id_carrier`   INT(11) UNSIGNED NOT NULL,
326  PRIMARY KEY (`id_cart_rule`, `id_carrier`)
327)
328  ENGINE = InnoDB
329  DEFAULT CHARSET = utf8mb4
330  DEFAULT COLLATE utf8mb4_unicode_ci;
331
332CREATE TABLE `PREFIX_cart_rule_combination` (
333  `id_cart_rule_1` INT(11) UNSIGNED NOT NULL,
334  `id_cart_rule_2` INT(11) UNSIGNED NOT NULL,
335  PRIMARY KEY (`id_cart_rule_1`, `id_cart_rule_2`),
336  KEY `id_cart_rule_1` (`id_cart_rule_1`),
337  KEY `id_cart_rule_2` (`id_cart_rule_2`)
338)
339  ENGINE = InnoDB
340  DEFAULT CHARSET = utf8mb4
341  DEFAULT COLLATE utf8mb4_unicode_ci;
342
343CREATE TABLE `PREFIX_cart_rule_product_rule_group` (
344  `id_product_rule_group` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
345  `id_cart_rule`          INT(11) UNSIGNED NOT NULL,
346  `quantity`              INT(11) UNSIGNED NOT NULL DEFAULT 1,
347  PRIMARY KEY (`id_product_rule_group`)
348)
349  ENGINE = InnoDB
350  DEFAULT CHARSET = utf8mb4
351  DEFAULT COLLATE utf8mb4_unicode_ci;
352
353CREATE TABLE `PREFIX_cart_rule_product_rule` (
354  `id_product_rule`       INT(11) UNSIGNED                                                            NOT NULL AUTO_INCREMENT,
355  `id_product_rule_group` INT(11) UNSIGNED                                                            NOT NULL,
356  `type`                  ENUM ('products', 'categories', 'attributes', 'manufacturers', 'suppliers') NOT NULL,
357  PRIMARY KEY (`id_product_rule`)
358)
359  ENGINE = InnoDB
360  DEFAULT CHARSET = utf8mb4
361  DEFAULT COLLATE utf8mb4_unicode_ci;
362
363CREATE TABLE `PREFIX_cart_rule_product_rule_value` (
364  `id_product_rule` INT(11) UNSIGNED NOT NULL,
365  `id_item`         INT(11) UNSIGNED NOT NULL,
366  PRIMARY KEY (`id_product_rule`, `id_item`)
367)
368  ENGINE = InnoDB
369  DEFAULT CHARSET = utf8mb4
370  DEFAULT COLLATE utf8mb4_unicode_ci;
371
372CREATE TABLE `PREFIX_cart_cart_rule` (
373  `id_cart`      INT(11) UNSIGNED NOT NULL,
374  `id_cart_rule` INT(11) UNSIGNED NOT NULL,
375  PRIMARY KEY (`id_cart`, `id_cart_rule`),
376  KEY (`id_cart_rule`)
377)
378  ENGINE = InnoDB
379  DEFAULT CHARSET = utf8mb4
380  DEFAULT COLLATE utf8mb4_unicode_ci;
381
382CREATE TABLE `PREFIX_cart_rule_shop` (
383  `id_cart_rule` INT(11) UNSIGNED NOT NULL,
384  `id_shop`      INT(11) UNSIGNED NOT NULL,
385  PRIMARY KEY (`id_cart_rule`, `id_shop`)
386)
387  ENGINE = InnoDB
388  DEFAULT CHARSET = utf8mb4
389  DEFAULT COLLATE utf8mb4_unicode_ci;
390
391CREATE TABLE `PREFIX_cart_product` (
392  `id_cart`              INT(11) UNSIGNED NOT NULL,
393  `id_product`           INT(11) UNSIGNED NOT NULL,
394  `id_address_delivery`  INT(11) UNSIGNED          DEFAULT '0',
395  `id_shop`              INT(11) UNSIGNED NOT NULL DEFAULT '1',
396  `id_product_attribute` INT(11) UNSIGNED NOT NULL DEFAULT '0',
397  `quantity`             INT(11) UNSIGNED NOT NULL DEFAULT '0',
398  `date_add`             DATETIME         NOT NULL,
399  PRIMARY KEY (`id_cart`, `id_product`, `id_product_attribute`, `id_address_delivery`),
400  KEY `id_product_attribute` (`id_product_attribute`),
401  KEY `id_cart_order` (`id_cart`, `date_add`, `id_product`, `id_product_attribute`)
402)
403  ENGINE = InnoDB
404  DEFAULT CHARSET = utf8mb4
405  DEFAULT COLLATE utf8mb4_unicode_ci;
406
407CREATE TABLE `PREFIX_category` (
408  `id_category`      INT(11) UNSIGNED    NOT NULL AUTO_INCREMENT,
409  `id_parent`        INT(11) UNSIGNED    NOT NULL,
410  `id_shop_default`  INT(11) UNSIGNED    NOT NULL DEFAULT 1,
411  `level_depth`      TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
412  `nleft`            INT(11) UNSIGNED    NOT NULL DEFAULT '0',
413  `nright`           INT(11) UNSIGNED    NOT NULL DEFAULT '0',
414  `active`           TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
415  `display_from_sub` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
416  `date_add`         DATETIME            NOT NULL,
417  `date_upd`         DATETIME            NOT NULL,
418  `position`         INT(11) UNSIGNED    NOT NULL DEFAULT '0',
419  `is_root_category` TINYINT(1)          NOT NULL DEFAULT '0',
420  PRIMARY KEY (`id_category`),
421  KEY `category_parent` (`id_parent`),
422  KEY `nleftrightactive` (`nleft`, `nright`, `active`),
423  KEY `level_depth` (`level_depth`),
424  KEY `nright` (`nright`),
425  KEY `activenleft` (`active`, `nleft`),
426  KEY `activenright` (`active`, `nright`)
427)
428  ENGINE = InnoDB
429  DEFAULT CHARSET = utf8mb4
430  DEFAULT COLLATE utf8mb4_unicode_ci;
431
432CREATE TABLE `PREFIX_category_group` (
433  `id_category` INT(11) UNSIGNED NOT NULL,
434  `id_group`    INT(11) UNSIGNED NOT NULL,
435  PRIMARY KEY (`id_category`, `id_group`),
436  KEY `id_category` (`id_category`),
437  KEY `id_group` (`id_group`)
438)
439  ENGINE = InnoDB
440  DEFAULT CHARSET = utf8mb4
441  DEFAULT COLLATE utf8mb4_unicode_ci;
442
443CREATE TABLE `PREFIX_category_lang` (
444  `id_category`      INT(11) UNSIGNED NOT NULL,
445  `id_shop`          INT(11) UNSIGNED NOT NULL DEFAULT '1',
446  `id_lang`          INT(11) UNSIGNED NOT NULL,
447  `name`             VARCHAR(128)     NOT NULL,
448  `description`      TEXT,
449  `link_rewrite`     VARCHAR(128)     NOT NULL,
450  `meta_title`       VARCHAR(128)              DEFAULT NULL,
451  `meta_keywords`    VARCHAR(255)              DEFAULT NULL,
452  `meta_description` VARCHAR(255)              DEFAULT NULL,
453  PRIMARY KEY (`id_category`, `id_shop`, `id_lang`),
454  KEY `category_name` (`name`)
455)
456  ENGINE = InnoDB
457  DEFAULT CHARSET = utf8mb4
458  DEFAULT COLLATE utf8mb4_unicode_ci;
459
460CREATE TABLE `PREFIX_category_product` (
461  `id_category` INT(11) UNSIGNED NOT NULL,
462  `id_product`  INT(11) UNSIGNED NOT NULL,
463  `position`    INT(11) UNSIGNED NOT NULL DEFAULT '0',
464  PRIMARY KEY (`id_category`, `id_product`),
465  INDEX (`id_product`),
466  INDEX (`id_category`, `position`)
467)
468  ENGINE = InnoDB
469  DEFAULT CHARSET = utf8mb4
470  DEFAULT COLLATE utf8mb4_unicode_ci;
471
472CREATE TABLE `PREFIX_cms` (
473  `id_cms`          INT(11) UNSIGNED    NOT NULL AUTO_INCREMENT,
474  `id_cms_category` INT(11) UNSIGNED    NOT NULL,
475  `position`        INT(11) UNSIGNED    NOT NULL DEFAULT '0',
476  `active`          TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
477  `indexation`      TINYINT(1) UNSIGNED NOT NULL DEFAULT '1',
478  PRIMARY KEY (`id_cms`)
479)
480  ENGINE = InnoDB
481  DEFAULT CHARSET = utf8mb4
482  DEFAULT COLLATE utf8mb4_unicode_ci;
483
484CREATE TABLE `PREFIX_cms_lang` (
485  `id_cms`           INT(11) UNSIGNED NOT NULL,
486  `id_lang`          INT(11) UNSIGNED NOT NULL,
487  `id_shop`          INT(11) UNSIGNED NOT NULL DEFAULT '1',
488  `meta_title`       VARCHAR(128)     NOT NULL,
489  `meta_description` VARCHAR(255)              DEFAULT NULL,
490  `meta_keywords`    VARCHAR(255)              DEFAULT NULL,
491  `content`          LONGTEXT,
492  `link_rewrite`     VARCHAR(128)     NOT NULL,
493  PRIMARY KEY (`id_cms`, `id_shop`, `id_lang`)
494)
495  ENGINE = InnoDB
496  DEFAULT CHARSET = utf8mb4
497  DEFAULT COLLATE utf8mb4_unicode_ci;
498
499CREATE TABLE `PREFIX_cms_category` (
500  `id_cms_category` INT(11) UNSIGNED    NOT NULL AUTO_INCREMENT,
501  `id_parent`       INT(11) UNSIGNED    NOT NULL,
502  `level_depth`     TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
503  `active`          TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
504  `date_add`        DATETIME            NOT NULL,
505  `date_upd`        DATETIME            NOT NULL,
506  `position`        INT(11) UNSIGNED    NOT NULL DEFAULT '0',
507  PRIMARY KEY (`id_cms_category`),
508  KEY `category_parent` (`id_parent`)
509)
510  ENGINE = InnoDB
511  DEFAULT CHARSET = utf8mb4
512  DEFAULT COLLATE utf8mb4_unicode_ci;
513
514CREATE TABLE `PREFIX_cms_category_lang` (
515  `id_cms_category`  INT(11) UNSIGNED NOT NULL,
516  `id_lang`          INT(11) UNSIGNED NOT NULL,
517  `id_shop`          INT(11) UNSIGNED NOT NULL DEFAULT '1',
518  `name`             VARCHAR(128)     NOT NULL,
519  `description`      TEXT,
520  `link_rewrite`     VARCHAR(128)     NOT NULL,
521  `meta_title`       VARCHAR(128)              DEFAULT NULL,
522  `meta_keywords`    VARCHAR(255)              DEFAULT NULL,
523  `meta_description` VARCHAR(255)              DEFAULT NULL,
524  PRIMARY KEY (`id_cms_category`, `id_shop`, `id_lang`),
525  KEY `category_name` (`name`)
526)
527  ENGINE = InnoDB
528  DEFAULT CHARSET = utf8mb4
529  DEFAULT COLLATE utf8mb4_unicode_ci;
530
531CREATE TABLE `PREFIX_cms_category_shop` (
532  `id_cms_category` INT(11) UNSIGNED NOT NULL,
533  `id_shop`         INT(11) UNSIGNED NOT NULL,
534  PRIMARY KEY (`id_cms_category`, `id_shop`),
535  KEY `id_shop` (`id_shop`)
536)
537  ENGINE = InnoDB
538  DEFAULT CHARSET = utf8mb4
539  DEFAULT COLLATE utf8mb4_unicode_ci;
540
541CREATE TABLE `PREFIX_compare` (
542  `id_compare`  INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
543  `id_customer` INT(11) UNSIGNED NOT NULL,
544  PRIMARY KEY (`id_compare`)
545)
546  ENGINE = InnoDB
547  DEFAULT CHARSET = utf8mb4
548  DEFAULT COLLATE utf8mb4_unicode_ci;
549
550CREATE TABLE `PREFIX_compare_product` (
551  `id_compare` INT(11) UNSIGNED NOT NULL,
552  `id_product` INT(11) UNSIGNED NOT NULL,
553  `date_add`   DATETIME         NOT NULL,
554  `date_upd`   DATETIME         NOT NULL,
555  PRIMARY KEY (`id_compare`, `id_product`)
556)
557  ENGINE = InnoDB
558  DEFAULT CHARSET = utf8mb4
559  DEFAULT COLLATE utf8mb4_unicode_ci;
560
561CREATE TABLE `PREFIX_configuration` (
562  `id_configuration` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
563  `id_shop_group`    INT(11) UNSIGNED          DEFAULT NULL,
564  `id_shop`          INT(11) UNSIGNED          DEFAULT NULL,
565  `name`             VARCHAR(254)     NOT NULL,
566  `value`            TEXT,
567  `date_add`         DATETIME         NOT NULL,
568  `date_upd`         DATETIME         NOT NULL,
569  PRIMARY KEY (`id_configuration`),
570  KEY `id_shop` (`id_shop`),
571  KEY `id_shop_group` (`id_shop_group`)
572)
573  ENGINE = InnoDB
574  DEFAULT CHARSET = utf8mb4
575  DEFAULT COLLATE utf8mb4_unicode_ci;
576
577CREATE TABLE `PREFIX_configuration_lang` (
578  `id_configuration` INT(11) UNSIGNED NOT NULL,
579  `id_lang`          INT(11) UNSIGNED NOT NULL,
580  `value`            TEXT,
581  `date_upd`         DATETIME DEFAULT NULL,
582  PRIMARY KEY (`id_configuration`, `id_lang`)
583)
584  ENGINE = InnoDB
585  DEFAULT CHARSET = utf8mb4
586  DEFAULT COLLATE utf8mb4_unicode_ci;
587
588CREATE TABLE `PREFIX_configuration_kpi` (
589  `id_configuration_kpi` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
590  `id_shop_group`        INT(11) UNSIGNED          DEFAULT NULL,
591  `id_shop`              INT(11) UNSIGNED          DEFAULT NULL,
592  `name`                 VARCHAR(64)      NOT NULL,
593  `value`                TEXT,
594  `date_add`             DATETIME         NOT NULL,
595  `date_upd`             DATETIME         NOT NULL,
596  PRIMARY KEY (`id_configuration_kpi`),
597  KEY `name` (`name`),
598  KEY `id_shop` (`id_shop`),
599  KEY `id_shop_group` (`id_shop_group`)
600)
601  ENGINE = InnoDB
602  DEFAULT CHARSET = utf8mb4
603  DEFAULT COLLATE utf8mb4_unicode_ci;
604
605CREATE TABLE `PREFIX_configuration_kpi_lang` (
606  `id_configuration_kpi` INT(11) UNSIGNED NOT NULL,
607  `id_lang`              INT(11) UNSIGNED NOT NULL,
608  `value`                TEXT,
609  `date_upd`             DATETIME DEFAULT NULL,
610  PRIMARY KEY (`id_configuration_kpi`, `id_lang`)
611)
612  ENGINE = InnoDB
613  DEFAULT CHARSET = utf8mb4
614  DEFAULT COLLATE utf8mb4_unicode_ci;
615
616CREATE TABLE `PREFIX_connections` (
617  `id_connections` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
618  `id_shop_group`  INT(11) UNSIGNED NOT NULL DEFAULT '1',
619  `id_shop`        INT(11) UNSIGNED NOT NULL DEFAULT '1',
620  `id_guest`       INT(11) UNSIGNED NOT NULL,
621  `id_page`        INT(11) UNSIGNED NOT NULL,
622  `ip_address`     BIGINT           NULL     DEFAULT NULL,
623  `date_add`       DATETIME         NOT NULL,
624  `http_referer`   VARCHAR(255)              DEFAULT NULL,
625  PRIMARY KEY (`id_connections`),
626  KEY `id_guest` (`id_guest`),
627  KEY `date_add` (`date_add`),
628  KEY `id_page` (`id_page`)
629)
630  ENGINE = InnoDB
631  DEFAULT CHARSET = utf8mb4
632  DEFAULT COLLATE utf8mb4_unicode_ci;
633
634CREATE TABLE `PREFIX_connections_page` (
635  `id_connections` INT(11) UNSIGNED NOT NULL,
636  `id_page`        INT(11) UNSIGNED NOT NULL,
637  `time_start`     DATETIME         NOT NULL,
638  `time_end`       DATETIME DEFAULT NULL,
639  PRIMARY KEY (`id_connections`, `id_page`, `time_start`)
640)
641  ENGINE = InnoDB
642  DEFAULT CHARSET = utf8mb4
643  DEFAULT COLLATE utf8mb4_unicode_ci;
644
645CREATE TABLE `PREFIX_connections_source` (
646  `id_connections_source` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
647  `id_connections`        INT(11) UNSIGNED NOT NULL,
648  `http_referer`          VARCHAR(255)              DEFAULT NULL,
649  `request_uri`           VARCHAR(255)              DEFAULT NULL,
650  `keywords`              VARCHAR(255)              DEFAULT NULL,
651  `date_add`              DATETIME         NOT NULL,
652  PRIMARY KEY (`id_connections_source`),
653  KEY `connections` (`id_connections`),
654  KEY `orderby` (`date_add`)
655)
656  ENGINE = InnoDB
657  DEFAULT CHARSET = utf8mb4
658  DEFAULT COLLATE utf8mb4_unicode_ci;
659
660CREATE TABLE `PREFIX_contact` (
661  `id_contact`       INT(11) UNSIGNED    NOT NULL AUTO_INCREMENT,
662  `email`            VARCHAR(128)        NOT NULL,
663  `customer_service` TINYINT(1)          NOT NULL DEFAULT '0',
664  `position`         TINYINT(2) UNSIGNED NOT NULL DEFAULT '0',
665  PRIMARY KEY (`id_contact`)
666)
667  ENGINE = InnoDB
668  DEFAULT CHARSET = utf8mb4
669  DEFAULT COLLATE utf8mb4_unicode_ci;
670
671CREATE TABLE `PREFIX_contact_lang` (
672  `id_contact`  INT(11) UNSIGNED NOT NULL,
673  `id_lang`     INT(11) UNSIGNED NOT NULL,
674  `name`        VARCHAR(32)      NOT NULL,
675  `description` TEXT,
676  PRIMARY KEY (`id_contact`, `id_lang`)
677)
678  ENGINE = InnoDB
679  DEFAULT CHARSET = utf8mb4
680  DEFAULT COLLATE utf8mb4_unicode_ci;
681
682CREATE TABLE `PREFIX_country` (
683  `id_country`                 INT(11) UNSIGNED    NOT NULL AUTO_INCREMENT,
684  `id_zone`                    INT(11) UNSIGNED    NOT NULL,
685  `id_currency`                INT(11) UNSIGNED    NOT NULL DEFAULT '0',
686  `iso_code`                   VARCHAR(3)          NOT NULL,
687  `call_prefix`                INT(10)             NOT NULL DEFAULT '0',
688  `active`                     TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
689  `contains_states`            TINYINT(1)          NOT NULL DEFAULT '0',
690  `need_identification_number` TINYINT(1)          NOT NULL DEFAULT '0',
691  `need_zip_code`              TINYINT(1)          NOT NULL DEFAULT '1',
692  `zip_code_format`            VARCHAR(12)         NOT NULL DEFAULT '',
693  `display_tax_label`          BOOLEAN             NOT NULL,
694  PRIMARY KEY (`id_country`),
695  KEY `country_iso_code` (`iso_code`),
696  KEY `country_` (`id_zone`)
697)
698  ENGINE = InnoDB
699  DEFAULT CHARSET = utf8mb4
700  DEFAULT COLLATE utf8mb4_unicode_ci;
701
702CREATE TABLE `PREFIX_country_lang` (
703  `id_country` INT(11) UNSIGNED NOT NULL,
704  `id_lang`    INT(11) UNSIGNED NOT NULL,
705  `name`       VARCHAR(64)      NOT NULL,
706  PRIMARY KEY (`id_country`, `id_lang`)
707)
708  ENGINE = InnoDB
709  DEFAULT CHARSET = utf8mb4
710  DEFAULT COLLATE utf8mb4_unicode_ci;
711
712CREATE TABLE `PREFIX_currency` (
713  `id_currency`     INT(11) UNSIGNED    NOT NULL AUTO_INCREMENT,
714  `name`            VARCHAR(32)         NOT NULL,
715  `iso_code`        VARCHAR(3)          NOT NULL DEFAULT '0',
716  `iso_code_num`    VARCHAR(3)          NOT NULL DEFAULT '0',
717  `sign`            VARCHAR(8)          NOT NULL,
718  `blank`           TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
719  `format`          TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
720  `decimals`        TINYINT(1) UNSIGNED NOT NULL DEFAULT '1',
721  `conversion_rate` DECIMAL(13, 6)      NOT NULL,
722  `deleted`         TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
723  `active`          TINYINT(1) UNSIGNED NOT NULL DEFAULT '1',
724  PRIMARY KEY (`id_currency`)
725)
726  ENGINE = InnoDB
727  DEFAULT CHARSET = utf8mb4
728  DEFAULT COLLATE utf8mb4_unicode_ci;
729
730CREATE TABLE `PREFIX_customer` (
731  `id_customer`                INT(11) UNSIGNED    NOT NULL AUTO_INCREMENT,
732  `id_shop_group`              INT(11) UNSIGNED    NOT NULL DEFAULT '1',
733  `id_shop`                    INT(11) UNSIGNED    NOT NULL DEFAULT '1',
734  `id_gender`                  INT(11) UNSIGNED    NOT NULL,
735  `id_default_group`           INT(11) UNSIGNED    NOT NULL DEFAULT '1',
736  `id_lang`                    INT(11) UNSIGNED    NULL,
737  `id_risk`                    INT(11) UNSIGNED    NOT NULL DEFAULT '1',
738  `company`                    VARCHAR(64),
739  `siret`                      VARCHAR(14),
740  `ape`                        VARCHAR(5),
741  `firstname`                  VARCHAR(32)         NOT NULL,
742  `lastname`                   VARCHAR(32)         NOT NULL,
743  `email`                      VARCHAR(128)        NOT NULL,
744  `passwd`                     VARCHAR(60)         NOT NULL,
745  `last_passwd_gen`            TIMESTAMP           NOT NULL DEFAULT CURRENT_TIMESTAMP,
746  `birthday`                   DATE                         DEFAULT NULL,
747  `newsletter`                 TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
748  `ip_registration_newsletter` VARCHAR(15)                  DEFAULT NULL,
749  `newsletter_date_add`        DATETIME                     DEFAULT NULL,
750  `optin`                      TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
751  `website`                    VARCHAR(128),
752  `outstanding_allow_amount`   DECIMAL(20, 6)      NOT NULL DEFAULT 0,
753  `show_public_prices`         TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
754  `max_payment_days`           INT(11) UNSIGNED    NOT NULL DEFAULT '60',
755  `secure_key`                 VARCHAR(32)         NOT NULL DEFAULT '-1',
756  `note`                       TEXT,
757  `active`                     TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
758  `is_guest`                   TINYINT(1)          NOT NULL DEFAULT '0',
759  `deleted`                    TINYINT(1)          NOT NULL DEFAULT '0',
760  `date_add`                   DATETIME            NOT NULL,
761  `date_upd`                   DATETIME            NOT NULL,
762  PRIMARY KEY (`id_customer`),
763  KEY `customer_email` (`email`),
764  KEY `customer_login` (`email`, `passwd`),
765  KEY `id_customer_passwd` (`id_customer`, `passwd`),
766  KEY `id_gender` (`id_gender`),
767  KEY `id_shop_group` (`id_shop_group`),
768  KEY `id_shop` (`id_shop`, `date_add`)
769)
770  ENGINE = InnoDB
771  DEFAULT CHARSET = utf8mb4
772  DEFAULT COLLATE utf8mb4_unicode_ci;
773
774CREATE TABLE `PREFIX_customer_group` (
775  `id_customer` INT(11) UNSIGNED NOT NULL,
776  `id_group`    INT(11) UNSIGNED NOT NULL,
777  PRIMARY KEY (`id_customer`, `id_group`),
778  INDEX customer_login(id_group),
779  KEY `id_customer` (`id_customer`)
780)
781  ENGINE = InnoDB
782  DEFAULT CHARSET = utf8mb4
783  DEFAULT COLLATE utf8mb4_unicode_ci;
784
785CREATE TABLE `PREFIX_customer_message` (
786  `id_customer_message` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
787  `id_customer_thread`  INT(11)                   DEFAULT NULL,
788  `id_employee`         INT(11) UNSIGNED          DEFAULT NULL,
789  `message`             MEDIUMTEXT       NOT NULL,
790  `file_name`           VARCHAR(18)               DEFAULT NULL,
791  `ip_address`          VARCHAR(16)               DEFAULT NULL,
792  `user_agent`          VARCHAR(128)              DEFAULT NULL,
793  `date_add`            DATETIME         NOT NULL,
794  `date_upd`            DATETIME         NOT NULL,
795  `private`             TINYINT          NOT NULL DEFAULT '0',
796  `read`                TINYINT(1)       NOT NULL DEFAULT '0',
797  PRIMARY KEY (`id_customer_message`),
798  KEY `id_customer_thread` (`id_customer_thread`),
799  KEY `id_employee` (`id_employee`)
800)
801  ENGINE = InnoDB
802  DEFAULT CHARSET = utf8mb4
803  DEFAULT COLLATE utf8mb4_unicode_ci;
804
805
806CREATE TABLE `PREFIX_customer_message_sync_imap` (
807  `md5_header` VARBINARY(32) NOT NULL,
808  KEY `md5_header_index` (`md5_header`(4))
809)
810  ENGINE = InnoDB
811  DEFAULT CHARSET = utf8mb4
812  DEFAULT COLLATE utf8mb4_unicode_ci;
813
814CREATE TABLE `PREFIX_customer_thread` (
815  `id_customer_thread` INT(11) UNSIGNED                                NOT NULL AUTO_INCREMENT,
816  `id_shop`            INT(11) UNSIGNED                                NOT NULL DEFAULT '1',
817  `id_lang`            INT(11) UNSIGNED                                NOT NULL,
818  `id_contact`         INT(11) UNSIGNED                                NOT NULL,
819  `id_customer`        INT(11) UNSIGNED                                         DEFAULT NULL,
820  `id_order`           INT(11) UNSIGNED                                         DEFAULT NULL,
821  `id_product`         INT(11) UNSIGNED                                         DEFAULT NULL,
822  `status`             ENUM ('open', 'closed', 'pending1', 'pending2') NOT NULL DEFAULT 'open',
823  `email`              VARCHAR(128)                                    NOT NULL,
824  `token`              VARCHAR(12)                                              DEFAULT NULL,
825  `date_add`           DATETIME                                        NOT NULL,
826  `date_upd`           DATETIME                                        NOT NULL,
827  PRIMARY KEY (`id_customer_thread`),
828  KEY `id_shop` (`id_shop`),
829  KEY `id_lang` (`id_lang`),
830  KEY `id_contact` (`id_contact`),
831  KEY `id_customer` (`id_customer`),
832  KEY `id_order` (`id_order`),
833  KEY `id_product` (`id_product`)
834)
835  ENGINE = InnoDB
836  DEFAULT CHARSET = utf8mb4
837  DEFAULT COLLATE utf8mb4_unicode_ci;
838
839
840CREATE TABLE `PREFIX_customization` (
841  `id_customization`     INT(11) UNSIGNED    NOT NULL AUTO_INCREMENT,
842  `id_product_attribute` INT(11) UNSIGNED    NOT NULL DEFAULT '0',
843  `id_address_delivery`  INT(11) UNSIGNED    NOT NULL DEFAULT '0',
844  `id_cart`              INT(11) UNSIGNED    NOT NULL,
845  `id_product`           INT(10)             NOT NULL,
846  `quantity`             INT(10)             NOT NULL,
847  `quantity_refunded`    INT                 NOT NULL DEFAULT '0',
848  `quantity_returned`    INT                 NOT NULL DEFAULT '0',
849  `in_cart`              TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
850  PRIMARY KEY (`id_customization`, `id_cart`, `id_product`, `id_address_delivery`),
851  KEY `id_product_attribute` (`id_product_attribute`),
852  KEY `id_cart_product` (`id_cart`, `id_product`, `id_product_attribute`)
853)
854  ENGINE = InnoDB
855  DEFAULT CHARSET = utf8mb4
856  DEFAULT COLLATE utf8mb4_unicode_ci;
857
858CREATE TABLE `PREFIX_customization_field` (
859  `id_customization_field` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
860  `id_product`             INT(11) UNSIGNED NOT NULL,
861  `type`                   TINYINT(1)       NOT NULL,
862  `required`               TINYINT(1)       NOT NULL,
863  PRIMARY KEY (`id_customization_field`),
864  KEY `id_product` (`id_product`)
865)
866  ENGINE = InnoDB
867  DEFAULT CHARSET = utf8mb4
868  DEFAULT COLLATE utf8mb4_unicode_ci;
869
870CREATE TABLE `PREFIX_customization_field_lang` (
871  `id_customization_field` INT(11) UNSIGNED NOT NULL,
872  `id_lang`                INT(11) UNSIGNED NOT NULL,
873  `id_shop`                INT(11) UNSIGNED NOT NULL DEFAULT '1',
874  `name`                   VARCHAR(255)     NOT NULL,
875  PRIMARY KEY (`id_customization_field`, `id_lang`, `id_shop`)
876)
877  ENGINE = InnoDB
878  DEFAULT CHARSET = utf8mb4
879  DEFAULT COLLATE utf8mb4_unicode_ci;
880
881CREATE TABLE `PREFIX_customized_data` (
882  `id_customization` INT(11) UNSIGNED NOT NULL,
883  `type`             TINYINT(1)       NOT NULL,
884  `index`            INT(3)           NOT NULL,
885  `value`            VARCHAR(255)     NOT NULL,
886  PRIMARY KEY (`id_customization`, `type`, `index`)
887)
888  ENGINE = InnoDB
889  DEFAULT CHARSET = utf8mb4
890  DEFAULT COLLATE utf8mb4_unicode_ci;
891
892CREATE TABLE `PREFIX_date_range` (
893  `id_date_range` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
894  `time_start`    DATETIME         NOT NULL,
895  `time_end`      DATETIME         NOT NULL,
896  PRIMARY KEY (`id_date_range`)
897)
898  ENGINE = InnoDB
899  DEFAULT CHARSET = utf8mb4
900  DEFAULT COLLATE utf8mb4_unicode_ci;
901
902CREATE TABLE `PREFIX_delivery` (
903  `id_delivery`     INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
904  `id_shop`         INT UNSIGNED     NULL     DEFAULT NULL,
905  `id_shop_group`   INT UNSIGNED     NULL     DEFAULT NULL,
906  `id_carrier`      INT(11) UNSIGNED NOT NULL,
907  `id_range_price`  INT(11) UNSIGNED          DEFAULT NULL,
908  `id_range_weight` INT(11) UNSIGNED          DEFAULT NULL,
909  `id_zone`         INT(11) UNSIGNED NOT NULL,
910  `price`           DECIMAL(20, 6)   NOT NULL,
911  PRIMARY KEY (`id_delivery`),
912  KEY `id_zone` (`id_zone`),
913  KEY `id_carrier` (`id_carrier`, `id_zone`),
914  KEY `id_range_price` (`id_range_price`),
915  KEY `id_range_weight` (`id_range_weight`)
916)
917  ENGINE = InnoDB
918  DEFAULT CHARSET = utf8mb4
919  DEFAULT COLLATE utf8mb4_unicode_ci;
920
921CREATE TABLE `PREFIX_employee` (
922  `id_employee`              INT(11) UNSIGNED    NOT NULL AUTO_INCREMENT,
923  `id_profile`               INT(11) UNSIGNED    NOT NULL,
924  `id_lang`                  INT(11) UNSIGNED    NOT NULL DEFAULT '0',
925  `lastname`                 VARCHAR(32)         NOT NULL,
926  `firstname`                VARCHAR(32)         NOT NULL,
927  `email`                    VARCHAR(128)        NOT NULL,
928  `passwd`                   VARCHAR(60)         NOT NULL,
929  `last_passwd_gen`          TIMESTAMP           NOT NULL DEFAULT CURRENT_TIMESTAMP,
930  `stats_date_from`          DATE                         DEFAULT NULL,
931  `stats_date_to`            DATE                         DEFAULT NULL,
932  `stats_compare_from`       DATE                         DEFAULT NULL,
933  `stats_compare_to`         DATE                         DEFAULT NULL,
934  `stats_compare_option`     INT(1) UNSIGNED     NOT NULL DEFAULT 1,
935  `preselect_date_range`     VARCHAR(32)                  DEFAULT NULL,
936  `bo_color`                 VARCHAR(32)                  DEFAULT NULL,
937  `bo_theme`                 VARCHAR(32)                  DEFAULT NULL,
938  `bo_css`                   VARCHAR(64)                  DEFAULT NULL,
939  `default_tab`              INT(11) UNSIGNED    NOT NULL DEFAULT '0',
940  `bo_width`                 INT(11) UNSIGNED    NOT NULL DEFAULT '0',
941  `bo_menu`                  TINYINT(1)          NOT NULL DEFAULT '1',
942  `active`                   TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
943  `optin`                    TINYINT(1) UNSIGNED NOT NULL DEFAULT '1',
944  `id_last_order`            INT(11) UNSIGNED    NOT NULL DEFAULT '0',
945  `id_last_customer_message` INT(11) UNSIGNED    NOT NULL DEFAULT '0',
946  `id_last_customer`         INT(11) UNSIGNED    NOT NULL DEFAULT '0',
947  `last_connection_date`     DATE                         DEFAULT '1970-01-01',
948  PRIMARY KEY (`id_employee`),
949  KEY `employee_login` (`email`, `passwd`),
950  KEY `id_employee_passwd` (`id_employee`, `passwd`),
951  KEY `id_profile` (`id_profile`)
952)
953  ENGINE = InnoDB
954  DEFAULT CHARSET = utf8mb4
955  DEFAULT COLLATE utf8mb4_unicode_ci;
956
957CREATE TABLE `PREFIX_employee_shop` (
958  `id_employee` INT(11) UNSIGNED NOT NULL,
959  `id_shop`     INT(11) UNSIGNED NOT NULL,
960  PRIMARY KEY (`id_employee`, `id_shop`),
961  KEY `id_shop` (`id_shop`)
962)
963  ENGINE = InnoDB
964  DEFAULT CHARSET = utf8mb4
965  DEFAULT COLLATE utf8mb4_unicode_ci;
966
967CREATE TABLE `PREFIX_feature` (
968  `id_feature` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
969  `position`   INT(11) UNSIGNED NOT NULL DEFAULT '0',
970  PRIMARY KEY (`id_feature`)
971)
972  ENGINE = InnoDB
973  DEFAULT CHARSET = utf8mb4
974  DEFAULT COLLATE utf8mb4_unicode_ci;
975
976CREATE TABLE `PREFIX_feature_lang` (
977  `id_feature` INT(11) UNSIGNED NOT NULL,
978  `id_lang`    INT(11) UNSIGNED NOT NULL,
979  `name`       VARCHAR(128) DEFAULT NULL,
980  PRIMARY KEY (`id_feature`, `id_lang`),
981  KEY (`id_lang`, `name`)
982)
983  ENGINE = InnoDB
984  DEFAULT CHARSET = utf8mb4
985  DEFAULT COLLATE utf8mb4_unicode_ci;
986
987CREATE TABLE `PREFIX_feature_product` (
988  `id_feature`       INT(11) UNSIGNED NOT NULL,
989  `id_product`       INT(11) UNSIGNED NOT NULL,
990  `id_feature_value` INT(11) UNSIGNED NOT NULL,
991  PRIMARY KEY (`id_feature`, `id_product`),
992  KEY `id_feature_value` (`id_feature_value`),
993  KEY `id_product` (`id_product`)
994)
995  ENGINE = InnoDB
996  DEFAULT CHARSET = utf8mb4
997  DEFAULT COLLATE utf8mb4_unicode_ci;
998
999CREATE TABLE `PREFIX_feature_value` (
1000  `id_feature_value` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
1001  `id_feature`       INT(11) UNSIGNED NOT NULL,
1002  `custom`           TINYINT(3) UNSIGNED       DEFAULT NULL,
1003  PRIMARY KEY (`id_feature_value`),
1004  KEY `feature` (`id_feature`)
1005)
1006  ENGINE = InnoDB
1007  DEFAULT CHARSET = utf8mb4
1008  DEFAULT COLLATE utf8mb4_unicode_ci;
1009
1010CREATE TABLE `PREFIX_feature_value_lang` (
1011  `id_feature_value` INT(11) UNSIGNED NOT NULL,
1012  `id_lang`          INT(11) UNSIGNED NOT NULL,
1013  `value`            VARCHAR(255) DEFAULT NULL,
1014  PRIMARY KEY (`id_feature_value`, `id_lang`)
1015)
1016  ENGINE = InnoDB
1017  DEFAULT CHARSET = utf8mb4
1018  DEFAULT COLLATE utf8mb4_unicode_ci;
1019
1020CREATE TABLE IF NOT EXISTS `PREFIX_gender` (
1021  `id_gender` INT(11)    NOT NULL AUTO_INCREMENT,
1022  `type`      TINYINT(1) NOT NULL,
1023  PRIMARY KEY (`id_gender`)
1024)
1025  ENGINE = InnoDB
1026  DEFAULT CHARSET = utf8mb4
1027  DEFAULT COLLATE utf8mb4_unicode_ci;
1028
1029CREATE TABLE IF NOT EXISTS `PREFIX_gender_lang` (
1030  `id_gender` INT(11) UNSIGNED NOT NULL,
1031  `id_lang`   INT(11) UNSIGNED NOT NULL,
1032  `name`      VARCHAR(20)      NOT NULL,
1033  PRIMARY KEY (`id_gender`, `id_lang`),
1034  KEY `id_gender` (`id_gender`)
1035)
1036  ENGINE = InnoDB
1037  DEFAULT CHARSET = utf8mb4
1038  DEFAULT COLLATE utf8mb4_unicode_ci;
1039
1040CREATE TABLE `PREFIX_group` (
1041  `id_group`             INT(11) UNSIGNED    NOT NULL AUTO_INCREMENT,
1042  `reduction`            DECIMAL(17, 2)      NOT NULL DEFAULT 0,
1043  `price_display_method` TINYINT             NOT NULL DEFAULT '0',
1044  `show_prices`          TINYINT(1) UNSIGNED NOT NULL DEFAULT '1',
1045  `date_add`             DATETIME            NOT NULL,
1046  `date_upd`             DATETIME            NOT NULL,
1047  PRIMARY KEY (`id_group`)
1048)
1049  ENGINE = InnoDB
1050  DEFAULT CHARSET = utf8mb4
1051  DEFAULT COLLATE utf8mb4_unicode_ci;
1052
1053CREATE TABLE `PREFIX_group_lang` (
1054  `id_group` INT(11) UNSIGNED NOT NULL,
1055  `id_lang`  INT(11) UNSIGNED NOT NULL,
1056  `name`     VARCHAR(32)      NOT NULL,
1057  PRIMARY KEY (`id_group`, `id_lang`)
1058)
1059  ENGINE = InnoDB
1060  DEFAULT CHARSET = utf8mb4
1061  DEFAULT COLLATE utf8mb4_unicode_ci;
1062
1063CREATE TABLE `PREFIX_group_reduction` (
1064  `id_group_reduction` MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT,
1065  `id_group`           INT(11) UNSIGNED   NOT NULL,
1066  `id_category`        INT(11) UNSIGNED   NOT NULL,
1067  `reduction`          DECIMAL(4, 3)      NOT NULL,
1068  PRIMARY KEY (`id_group_reduction`),
1069  UNIQUE KEY (`id_group`, `id_category`)
1070)
1071  ENGINE = InnoDB
1072  DEFAULT CHARSET = utf8mb4
1073  DEFAULT COLLATE utf8mb4_unicode_ci;
1074
1075CREATE TABLE `PREFIX_product_group_reduction_cache` (
1076  `id_product` INT UNSIGNED  NOT NULL,
1077  `id_group`   INT UNSIGNED  NOT NULL,
1078  `reduction`  DECIMAL(4, 3) NOT NULL,
1079  PRIMARY KEY (`id_product`, `id_group`)
1080)
1081  ENGINE = InnoDB
1082  DEFAULT CHARSET = utf8mb4
1083  DEFAULT COLLATE utf8mb4_unicode_ci;
1084
1085CREATE TABLE `PREFIX_product_carrier` (
1086  `id_product`           INT(11) UNSIGNED NOT NULL,
1087  `id_carrier_reference` INT(11) UNSIGNED NOT NULL,
1088  `id_shop`              INT(11) UNSIGNED NOT NULL,
1089  PRIMARY KEY (`id_product`, `id_carrier_reference`, `id_shop`)
1090)
1091  ENGINE = InnoDB
1092  DEFAULT CHARSET = utf8mb4
1093  DEFAULT COLLATE utf8mb4_unicode_ci;
1094
1095CREATE TABLE `PREFIX_guest` (
1096  `id_guest`            INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
1097  `id_operating_system` INT(11) UNSIGNED          DEFAULT NULL,
1098  `id_web_browser`      INT(11) UNSIGNED          DEFAULT NULL,
1099  `id_customer`         INT(11) UNSIGNED          DEFAULT NULL,
1100  `javascript`          TINYINT(1)                DEFAULT '0',
1101  `screen_resolution_x` SMALLINT(5) UNSIGNED      DEFAULT NULL,
1102  `screen_resolution_y` SMALLINT(5) UNSIGNED      DEFAULT NULL,
1103  `screen_color`        TINYINT(3) UNSIGNED       DEFAULT NULL,
1104  `sun_java`            TINYINT(1)                DEFAULT NULL,
1105  `adobe_flash`         TINYINT(1)                DEFAULT NULL,
1106  `adobe_director`      TINYINT(1)                DEFAULT NULL,
1107  `apple_quicktime`     TINYINT(1)                DEFAULT NULL,
1108  `real_player`         TINYINT(1)                DEFAULT NULL,
1109  `windows_media`       TINYINT(1)                DEFAULT NULL,
1110  `accept_language`     VARCHAR(8)                DEFAULT NULL,
1111  `mobile_theme`        TINYINT(1)       NOT NULL DEFAULT '0',
1112  PRIMARY KEY (`id_guest`),
1113  KEY `id_customer` (`id_customer`),
1114  KEY `id_operating_system` (`id_operating_system`),
1115  KEY `id_web_browser` (`id_web_browser`)
1116)
1117  ENGINE = InnoDB
1118  DEFAULT CHARSET = utf8mb4
1119  DEFAULT COLLATE utf8mb4_unicode_ci;
1120
1121CREATE TABLE `PREFIX_hook` (
1122  `id_hook`     INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
1123  `name`        VARCHAR(64)      NOT NULL,
1124  `title`       VARCHAR(64)      NOT NULL,
1125  `description` TEXT,
1126  `position`    TINYINT(1)       NOT NULL DEFAULT '1',
1127  `live_edit`   TINYINT(1)       NOT NULL DEFAULT '0',
1128  PRIMARY KEY (`id_hook`),
1129  UNIQUE KEY `hook_name` (`name`)
1130)
1131  ENGINE = InnoDB
1132  DEFAULT CHARSET = utf8mb4
1133  DEFAULT COLLATE utf8mb4_unicode_ci;
1134
1135CREATE TABLE `PREFIX_hook_alias` (
1136  `id_hook_alias` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
1137  `alias`         VARCHAR(64)      NOT NULL,
1138  `name`          VARCHAR(64)      NOT NULL,
1139  PRIMARY KEY (`id_hook_alias`),
1140  UNIQUE KEY `alias` (`alias`)
1141)
1142  ENGINE = InnoDB
1143  DEFAULT CHARSET = utf8mb4
1144  DEFAULT COLLATE utf8mb4_unicode_ci;
1145
1146CREATE TABLE `PREFIX_hook_module` (
1147  `id_module` INT(11) UNSIGNED    NOT NULL,
1148  `id_shop`   INT(11) UNSIGNED    NOT NULL DEFAULT '1',
1149  `id_hook`   INT(11) UNSIGNED    NOT NULL,
1150  `position`  TINYINT(2) UNSIGNED NOT NULL,
1151  PRIMARY KEY (`id_module`, `id_hook`, `id_shop`),
1152  KEY `id_hook` (`id_hook`),
1153  KEY `id_module` (`id_module`),
1154  KEY `position` (`id_shop`, `position`)
1155)
1156  ENGINE = InnoDB
1157  DEFAULT CHARSET = utf8mb4
1158  DEFAULT COLLATE utf8mb4_unicode_ci;
1159
1160CREATE TABLE `PREFIX_hook_module_exceptions` (
1161  `id_hook_module_exceptions` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
1162  `id_shop`                   INT(11) UNSIGNED NOT NULL DEFAULT '1',
1163  `id_module`                 INT(11) UNSIGNED NOT NULL,
1164  `id_hook`                   INT(11) UNSIGNED NOT NULL,
1165  `file_name`                 VARCHAR(255)              DEFAULT NULL,
1166  PRIMARY KEY (`id_hook_module_exceptions`),
1167  KEY `id_module` (`id_module`),
1168  KEY `id_hook` (`id_hook`)
1169)
1170  ENGINE = InnoDB
1171  DEFAULT CHARSET = utf8mb4
1172  DEFAULT COLLATE utf8mb4_unicode_ci;
1173
1174CREATE TABLE `PREFIX_image` (
1175  `id_image`   INT(11) UNSIGNED     NOT NULL AUTO_INCREMENT,
1176  `id_product` INT(11) UNSIGNED     NOT NULL,
1177  `position`   SMALLINT(2) UNSIGNED NOT NULL DEFAULT '0',
1178  `cover`      TINYINT(1) UNSIGNED  NULL     DEFAULT NULL,
1179  PRIMARY KEY (`id_image`),
1180  KEY `image_product` (`id_product`),
1181  UNIQUE KEY `id_product_cover` (`id_product`, `cover`),
1182  UNIQUE KEY `idx_product_image` (`id_image`, `id_product`, `cover`)
1183)
1184  ENGINE = InnoDB
1185  DEFAULT CHARSET = utf8mb4
1186  DEFAULT COLLATE utf8mb4_unicode_ci;
1187
1188CREATE TABLE `PREFIX_image_lang` (
1189  `id_image` INT(11) UNSIGNED NOT NULL,
1190  `id_lang`  INT(11) UNSIGNED NOT NULL,
1191  `legend`   VARCHAR(128) DEFAULT NULL,
1192  PRIMARY KEY (`id_image`, `id_lang`),
1193  KEY `id_image` (`id_image`)
1194)
1195  ENGINE = InnoDB
1196  DEFAULT CHARSET = utf8mb4
1197  DEFAULT COLLATE utf8mb4_unicode_ci;
1198
1199CREATE TABLE `PREFIX_image_type` (
1200  `id_image_type` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
1201  `name`          VARCHAR(64)      NOT NULL,
1202  `width`         INT(11) UNSIGNED NOT NULL,
1203  `height`        INT(11) UNSIGNED NOT NULL,
1204  `products`      TINYINT(1)       NOT NULL DEFAULT '1',
1205  `categories`    TINYINT(1)       NOT NULL DEFAULT '1',
1206  `manufacturers` TINYINT(1)       NOT NULL DEFAULT '1',
1207  `suppliers`     TINYINT(1)       NOT NULL DEFAULT '1',
1208  `scenes`        TINYINT(1)       NOT NULL DEFAULT '1',
1209  `stores`        TINYINT(1)       NOT NULL DEFAULT '1',
1210  PRIMARY KEY (`id_image_type`),
1211  KEY `image_type_name` (`name`)
1212)
1213  ENGINE = InnoDB
1214  DEFAULT CHARSET = utf8mb4
1215  DEFAULT COLLATE utf8mb4_unicode_ci;
1216
1217CREATE TABLE `PREFIX_lang` (
1218  `id_lang`          INT(11) UNSIGNED    NOT NULL AUTO_INCREMENT,
1219  `name`             VARCHAR(32)         NOT NULL,
1220  `active`           TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
1221  `iso_code`         CHAR(2)             NOT NULL,
1222  `language_code`    CHAR(5)             NOT NULL,
1223  `date_format_lite` CHAR(32)            NOT NULL DEFAULT 'Y-m-d',
1224  `date_format_full` CHAR(32)            NOT NULL DEFAULT 'Y-m-d H:i:s',
1225  `is_rtl`           TINYINT(1)          NOT NULL DEFAULT '0',
1226  PRIMARY KEY (`id_lang`),
1227  KEY `lang_iso_code` (`iso_code`)
1228)
1229  ENGINE = InnoDB
1230  DEFAULT CHARSET = utf8mb4
1231  DEFAULT COLLATE utf8mb4_unicode_ci;
1232
1233CREATE TABLE `PREFIX_manufacturer` (
1234  `id_manufacturer` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
1235  `name`            VARCHAR(64)      NOT NULL,
1236  `date_add`        DATETIME         NOT NULL,
1237  `date_upd`        DATETIME         NOT NULL,
1238  `active`          TINYINT(1)       NOT NULL DEFAULT '0',
1239  PRIMARY KEY (`id_manufacturer`)
1240)
1241  ENGINE = InnoDB
1242  DEFAULT CHARSET = utf8mb4
1243  DEFAULT COLLATE utf8mb4_unicode_ci;
1244
1245CREATE TABLE `PREFIX_manufacturer_lang` (
1246  `id_manufacturer`   INT(11) UNSIGNED NOT NULL,
1247  `id_lang`           INT(11) UNSIGNED NOT NULL,
1248  `description`       TEXT,
1249  `short_description` TEXT,
1250  `meta_title`        VARCHAR(128) DEFAULT NULL,
1251  `meta_keywords`     VARCHAR(255) DEFAULT NULL,
1252  `meta_description`  VARCHAR(255) DEFAULT NULL,
1253  PRIMARY KEY (`id_manufacturer`, `id_lang`)
1254)
1255  ENGINE = InnoDB
1256  DEFAULT CHARSET = utf8mb4
1257  DEFAULT COLLATE utf8mb4_unicode_ci;
1258
1259CREATE TABLE `PREFIX_message` (
1260  `id_message`  INT(11) UNSIGNED    NOT NULL AUTO_INCREMENT,
1261  `id_cart`     INT(11) UNSIGNED             DEFAULT NULL,
1262  `id_customer` INT(11) UNSIGNED    NOT NULL,
1263  `id_employee` INT(11) UNSIGNED             DEFAULT NULL,
1264  `id_order`    INT(11) UNSIGNED    NOT NULL,
1265  `message`     TEXT                NOT NULL,
1266  `private`     TINYINT(1) UNSIGNED NOT NULL DEFAULT '1',
1267  `date_add`    DATETIME            NOT NULL,
1268  PRIMARY KEY (`id_message`),
1269  KEY `message_order` (`id_order`),
1270  KEY `id_cart` (`id_cart`),
1271  KEY `id_customer` (`id_customer`),
1272  KEY `id_employee` (`id_employee`)
1273)
1274  ENGINE = InnoDB
1275  DEFAULT CHARSET = utf8mb4
1276  DEFAULT COLLATE utf8mb4_unicode_ci;
1277
1278CREATE TABLE `PREFIX_message_readed` (
1279  `id_message`  INT(11) UNSIGNED NOT NULL,
1280  `id_employee` INT(11) UNSIGNED NOT NULL,
1281  `date_add`    DATETIME         NOT NULL,
1282  PRIMARY KEY (`id_message`, `id_employee`)
1283)
1284  ENGINE = InnoDB
1285  DEFAULT CHARSET = utf8mb4
1286  DEFAULT COLLATE utf8mb4_unicode_ci;
1287
1288CREATE TABLE `PREFIX_meta` (
1289  `id_meta`      INT(11) UNSIGNED    NOT NULL AUTO_INCREMENT,
1290  `page`         VARCHAR(64)         NOT NULL,
1291  `configurable` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1',
1292  PRIMARY KEY (`id_meta`),
1293  UNIQUE KEY `page` (`page`)
1294)
1295  ENGINE = InnoDB
1296  DEFAULT CHARSET = utf8mb4
1297  DEFAULT COLLATE utf8mb4_unicode_ci;
1298
1299CREATE TABLE `PREFIX_meta_lang` (
1300  `id_meta`     INT(11) UNSIGNED NOT NULL,
1301  `id_shop`     INT(11) UNSIGNED NOT NULL DEFAULT '1',
1302  `id_lang`     INT(11) UNSIGNED NOT NULL,
1303  `title`       VARCHAR(128)              DEFAULT NULL,
1304  `description` VARCHAR(255)              DEFAULT NULL,
1305  `keywords`    VARCHAR(255)              DEFAULT NULL,
1306  `url_rewrite` VARCHAR(254)     NOT NULL,
1307  PRIMARY KEY (`id_meta`, `id_shop`, `id_lang`),
1308  KEY `id_shop` (`id_shop`),
1309  KEY `id_lang` (`id_lang`)
1310)
1311  ENGINE = InnoDB
1312  DEFAULT CHARSET = utf8mb4
1313  DEFAULT COLLATE utf8mb4_unicode_ci;
1314
1315CREATE TABLE `PREFIX_module` (
1316  `id_module` INT(11) UNSIGNED    NOT NULL AUTO_INCREMENT,
1317  `name`      VARCHAR(64)         NOT NULL,
1318  `active`    TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
1319  `version`   VARCHAR(8)          NOT NULL,
1320  PRIMARY KEY (`id_module`),
1321  KEY `name` (`name`)
1322)
1323  ENGINE = InnoDB
1324  DEFAULT CHARSET = utf8mb4
1325  DEFAULT COLLATE utf8mb4_unicode_ci;
1326
1327CREATE TABLE `PREFIX_module_access` (
1328  `id_profile` INT(11) UNSIGNED NOT NULL,
1329  `id_module`  INT(11) UNSIGNED NOT NULL,
1330  `view`       TINYINT(1)       NOT NULL DEFAULT '0',
1331  `configure`  TINYINT(1)       NOT NULL DEFAULT '0',
1332  `uninstall`  TINYINT(1)       NOT NULL DEFAULT '0',
1333  PRIMARY KEY (`id_profile`, `id_module`)
1334)
1335  ENGINE = InnoDB
1336  DEFAULT CHARSET = utf8mb4
1337  DEFAULT COLLATE utf8mb4_unicode_ci;
1338
1339CREATE TABLE `PREFIX_module_country` (
1340  `id_module`  INT(11) UNSIGNED NOT NULL,
1341  `id_shop`    INT(11) UNSIGNED NOT NULL DEFAULT '1',
1342  `id_country` INT(11) UNSIGNED NOT NULL,
1343  PRIMARY KEY (`id_module`, `id_shop`, `id_country`)
1344)
1345  ENGINE = InnoDB
1346  DEFAULT CHARSET = utf8mb4
1347  DEFAULT COLLATE utf8mb4_unicode_ci;
1348
1349CREATE TABLE `PREFIX_module_currency` (
1350  `id_module`   INT(11) UNSIGNED NOT NULL,
1351  `id_shop`     INT(11) UNSIGNED NOT NULL DEFAULT '1',
1352  `id_currency` INT(11)          NOT NULL,
1353  PRIMARY KEY (`id_module`, `id_shop`, `id_currency`),
1354  KEY `id_module` (`id_module`)
1355)
1356  ENGINE = InnoDB
1357  DEFAULT CHARSET = utf8mb4
1358  DEFAULT COLLATE utf8mb4_unicode_ci;
1359
1360CREATE TABLE `PREFIX_module_group` (
1361  `id_module` INT(11) UNSIGNED NOT NULL,
1362  `id_shop`   INT(11) UNSIGNED NOT NULL DEFAULT '1',
1363  `id_group`  INT(11) UNSIGNED NOT NULL,
1364  PRIMARY KEY (`id_module`, `id_shop`, `id_group`)
1365)
1366  ENGINE = InnoDB
1367  DEFAULT CHARSET = utf8mb4
1368  DEFAULT COLLATE utf8mb4_unicode_ci;
1369
1370CREATE TABLE `PREFIX_module_carrier` (
1371  `id_module`    INT(11) UNSIGNED NOT NULL,
1372  `id_shop`      INT(11) UNSIGNED NOT NULL DEFAULT '1',
1373  `id_reference` INT(11)          NOT NULL
1374)
1375  ENGINE = InnoDB
1376  DEFAULT CHARSET = utf8mb4
1377  DEFAULT COLLATE utf8mb4_unicode_ci;
1378
1379CREATE TABLE `PREFIX_operating_system` (
1380  `id_operating_system` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
1381  `name`                VARCHAR(64)               DEFAULT NULL,
1382  PRIMARY KEY (`id_operating_system`)
1383)
1384  ENGINE = InnoDB
1385  DEFAULT CHARSET = utf8mb4
1386  DEFAULT COLLATE utf8mb4_unicode_ci;
1387
1388CREATE TABLE `PREFIX_orders` (
1389  `id_order`                 INT(11) UNSIGNED    NOT NULL AUTO_INCREMENT,
1390  `reference`                VARCHAR(9),
1391  `id_shop_group`            INT(11) UNSIGNED    NOT NULL DEFAULT '1',
1392  `id_shop`                  INT(11) UNSIGNED    NOT NULL DEFAULT '1',
1393  `id_carrier`               INT(11) UNSIGNED    NOT NULL,
1394  `id_lang`                  INT(11) UNSIGNED    NOT NULL,
1395  `id_customer`              INT(11) UNSIGNED    NOT NULL,
1396  `id_cart`                  INT(11) UNSIGNED    NOT NULL,
1397  `id_currency`              INT(11) UNSIGNED    NOT NULL,
1398  `id_address_delivery`      INT(11) UNSIGNED    NOT NULL,
1399  `id_address_invoice`       INT(11) UNSIGNED    NOT NULL,
1400  `current_state`            INT(11) UNSIGNED    NOT NULL,
1401  `secure_key`               VARCHAR(32)         NOT NULL DEFAULT '-1',
1402  `payment`                  VARCHAR(255)        NOT NULL,
1403  `conversion_rate`          DECIMAL(13, 6)      NOT NULL DEFAULT 1,
1404  `module`                   VARCHAR(64)                  DEFAULT NULL,
1405  `recyclable`               TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
1406  `gift`                     TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
1407  `gift_message`             TEXT,
1408  `mobile_theme`             TINYINT(1)          NOT NULL DEFAULT '0',
1409  `shipping_number`          VARCHAR(64)                  DEFAULT NULL,
1410  `total_discounts`          DECIMAL(20, 6)      NOT NULL DEFAULT 0,
1411  `total_discounts_tax_incl` DECIMAL(20, 6)      NOT NULL DEFAULT 0,
1412  `total_discounts_tax_excl` DECIMAL(20, 6)      NOT NULL DEFAULT 0,
1413  `total_paid`               DECIMAL(20, 6)      NOT NULL DEFAULT 0,
1414  `total_paid_tax_incl`      DECIMAL(20, 6)      NOT NULL DEFAULT 0,
1415  `total_paid_tax_excl`      DECIMAL(20, 6)      NOT NULL DEFAULT 0,
1416  `total_paid_real`          DECIMAL(20, 6)      NOT NULL DEFAULT 0,
1417  `total_products`           DECIMAL(20, 6)      NOT NULL DEFAULT 0,
1418  `total_products_wt`        DECIMAL(20, 6)      NOT NULL DEFAULT 0,
1419  `total_shipping`           DECIMAL(20, 6)      NOT NULL DEFAULT 0,
1420  `total_shipping_tax_incl`  DECIMAL(20, 6)      NOT NULL DEFAULT 0,
1421  `total_shipping_tax_excl`  DECIMAL(20, 6)      NOT NULL DEFAULT 0,
1422  `carrier_tax_rate`         DECIMAL(10, 3)      NOT NULL DEFAULT 0,
1423  `total_wrapping`           DECIMAL(20, 6)      NOT NULL DEFAULT 0,
1424  `total_wrapping_tax_incl`  DECIMAL(20, 6)      NOT NULL DEFAULT 0,
1425  `total_wrapping_tax_excl`  DECIMAL(20, 6)      NOT NULL DEFAULT 0,
1426  `round_mode`               TINYINT(1)          NOT NULL DEFAULT '2',
1427  `round_type`               TINYINT(1)          NOT NULL DEFAULT '1',
1428  `invoice_number`           INT(11) UNSIGNED    NOT NULL DEFAULT '0',
1429  `delivery_number`          INT(11) UNSIGNED    NOT NULL DEFAULT '0',
1430  `invoice_date`             DATETIME            NOT NULL,
1431  `delivery_date`            DATETIME            NOT NULL,
1432  `valid`                    INT(1) UNSIGNED     NOT NULL DEFAULT '0',
1433  `date_add`                 DATETIME            NOT NULL,
1434  `date_upd`                 DATETIME            NOT NULL,
1435  PRIMARY KEY (`id_order`),
1436  KEY `reference` (`reference`),
1437  KEY `id_customer` (`id_customer`),
1438  KEY `id_cart` (`id_cart`),
1439  KEY `invoice_number` (`invoice_number`),
1440  KEY `id_carrier` (`id_carrier`),
1441  KEY `id_lang` (`id_lang`),
1442  KEY `id_currency` (`id_currency`),
1443  KEY `id_address_delivery` (`id_address_delivery`),
1444  KEY `id_address_invoice` (`id_address_invoice`),
1445  KEY `id_shop_group` (`id_shop_group`),
1446  KEY (`current_state`),
1447  KEY `id_shop` (`id_shop`),
1448  INDEX `date_add`(`date_add`)
1449)
1450  ENGINE = InnoDB
1451  DEFAULT CHARSET = utf8mb4
1452  DEFAULT COLLATE utf8mb4_unicode_ci;
1453
1454CREATE TABLE `PREFIX_order_detail_tax` (
1455  `id_order_detail` INT(11)        NOT NULL,
1456  `id_tax`          INT(11)        NOT NULL,
1457  `unit_amount`     DECIMAL(20, 6) NOT NULL DEFAULT 0,
1458  `total_amount`    DECIMAL(20, 6) NOT NULL DEFAULT 0,
1459  KEY (`id_order_detail`),
1460  KEY `id_tax` (`id_tax`)
1461)
1462  ENGINE = InnoDB
1463  DEFAULT CHARSET = utf8mb4
1464  DEFAULT COLLATE utf8mb4_unicode_ci;
1465
1466CREATE TABLE `PREFIX_order_invoice` (
1467  `id_order_invoice`                INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
1468  `id_order`                        INT(11)          NOT NULL,
1469  `number`                          INT(11)          NOT NULL,
1470  `delivery_number`                 INT(11)          NOT NULL,
1471  `delivery_date`                   DATETIME,
1472  `total_discount_tax_excl`         DECIMAL(20, 6)   NOT NULL DEFAULT 0,
1473  `total_discount_tax_incl`         DECIMAL(20, 6)   NOT NULL DEFAULT 0,
1474  `total_paid_tax_excl`             DECIMAL(20, 6)   NOT NULL DEFAULT 0,
1475  `total_paid_tax_incl`             DECIMAL(20, 6)   NOT NULL DEFAULT 0,
1476  `total_products`                  DECIMAL(20, 6)   NOT NULL DEFAULT 0,
1477  `total_products_wt`               DECIMAL(20, 6)   NOT NULL DEFAULT 0,
1478  `total_shipping_tax_excl`         DECIMAL(20, 6)   NOT NULL DEFAULT 0,
1479  `total_shipping_tax_incl`         DECIMAL(20, 6)   NOT NULL DEFAULT 0,
1480  `shipping_tax_computation_method` INT(11) UNSIGNED NOT NULL,
1481  `total_wrapping_tax_excl`         DECIMAL(20, 6)   NOT NULL DEFAULT 0,
1482  `total_wrapping_tax_incl`         DECIMAL(20, 6)   NOT NULL DEFAULT 0,
1483  `shop_address`                    TEXT                      DEFAULT NULL,
1484  `invoice_address`                 TEXT                      DEFAULT NULL,
1485  `delivery_address`                TEXT                      DEFAULT NULL,
1486  `note`                            TEXT,
1487  `date_add`                        DATETIME         NOT NULL,
1488  PRIMARY KEY (`id_order_invoice`),
1489  KEY `id_order` (`id_order`)
1490)
1491  ENGINE = InnoDB
1492  DEFAULT CHARSET = utf8mb4
1493  DEFAULT COLLATE utf8mb4_unicode_ci;
1494
1495CREATE TABLE IF NOT EXISTS `PREFIX_order_invoice_tax` (
1496  `id_order_invoice` INT(11)        NOT NULL,
1497  `type`             VARCHAR(15)    NOT NULL,
1498  `id_tax`           INT(11)        NOT NULL,
1499  `amount`           DECIMAL(20, 6) NOT NULL DEFAULT 0,
1500  KEY `id_tax` (`id_tax`)
1501)
1502  ENGINE = InnoDB
1503  DEFAULT CHARSET = utf8mb4
1504  DEFAULT COLLATE utf8mb4_unicode_ci;
1505
1506CREATE TABLE `PREFIX_order_detail` (
1507  `id_order_detail`               INT(11) UNSIGNED    NOT NULL AUTO_INCREMENT,
1508  `id_order`                      INT(11) UNSIGNED    NOT NULL,
1509  `id_order_invoice`              INT(11)                      DEFAULT NULL,
1510  `id_warehouse`                  INT(11) UNSIGNED             DEFAULT '0',
1511  `id_shop`                       INT(11) UNSIGNED    NOT NULL,
1512  `product_id`                    INT(11) UNSIGNED    NOT NULL,
1513  `product_attribute_id`          INT(11) UNSIGNED             DEFAULT NULL,
1514  `product_name`                  VARCHAR(255)        NOT NULL,
1515  `product_quantity`              INT(11) UNSIGNED    NOT NULL DEFAULT '0',
1516  `product_quantity_in_stock`     INT(10)             NOT NULL DEFAULT '0',
1517  `product_quantity_refunded`     INT(11) UNSIGNED    NOT NULL DEFAULT '0',
1518  `product_quantity_return`       INT(11) UNSIGNED    NOT NULL DEFAULT '0',
1519  `product_quantity_reinjected`   INT(11) UNSIGNED    NOT NULL DEFAULT '0',
1520  `product_price`                 DECIMAL(20, 6)      NOT NULL DEFAULT 0,
1521  `reduction_percent`             DECIMAL(10, 2)      NOT NULL DEFAULT 0,
1522  `reduction_amount`              DECIMAL(20, 6)      NOT NULL DEFAULT 0,
1523  `reduction_amount_tax_incl`     DECIMAL(20, 6)      NOT NULL DEFAULT 0,
1524  `reduction_amount_tax_excl`     DECIMAL(20, 6)      NOT NULL DEFAULT 0,
1525  `group_reduction`               DECIMAL(10, 2)      NOT NULL DEFAULT 0,
1526  `product_quantity_discount`     DECIMAL(20, 6)      NOT NULL DEFAULT 0,
1527  `product_ean13`                 VARCHAR(13)                  DEFAULT NULL,
1528  `product_upc`                   VARCHAR(12)                  DEFAULT NULL,
1529  `product_reference`             VARCHAR(32)                  DEFAULT NULL,
1530  `product_supplier_reference`    VARCHAR(32)                  DEFAULT NULL,
1531  `product_weight`                DECIMAL(20, 6)      NOT NULL,
1532  `id_tax_rules_group`            INT(11) UNSIGNED             DEFAULT '0',
1533  `tax_computation_method`        TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
1534  `tax_name`                      VARCHAR(16)         NOT NULL,
1535  `tax_rate`                      DECIMAL(10, 3)      NOT NULL DEFAULT 0,
1536  `ecotax`                        DECIMAL(20, 6)      NOT NULL DEFAULT 0,
1537  `ecotax_tax_rate`               DECIMAL(5, 3)       NOT NULL DEFAULT 0,
1538  `discount_quantity_applied`     TINYINT(1)          NOT NULL DEFAULT '0',
1539  `download_hash`                 VARCHAR(255)                 DEFAULT NULL,
1540  `download_nb`                   INT(11) UNSIGNED             DEFAULT '0',
1541  `download_deadline`             DATETIME                     DEFAULT NULL,
1542  `total_price_tax_incl`          DECIMAL(20, 6)      NOT NULL DEFAULT 0,
1543  `total_price_tax_excl`          DECIMAL(20, 6)      NOT NULL DEFAULT 0,
1544  `unit_price_tax_incl`           DECIMAL(20, 6)      NOT NULL DEFAULT 0,
1545  `unit_price_tax_excl`           DECIMAL(20, 6)      NOT NULL DEFAULT 0,
1546  `total_shipping_price_tax_incl` DECIMAL(20, 6)      NOT NULL DEFAULT 0,
1547  `total_shipping_price_tax_excl` DECIMAL(20, 6)      NOT NULL DEFAULT 0,
1548  `purchase_supplier_price`       DECIMAL(20, 6)      NOT NULL DEFAULT 0,
1549  `original_product_price`        DECIMAL(20, 6)      NOT NULL DEFAULT 0,
1550  `original_wholesale_price`      DECIMAL(20, 6)      NOT NULL DEFAULT 0,
1551  PRIMARY KEY (`id_order_detail`),
1552  KEY `order_detail_order` (`id_order`),
1553  KEY `product_id` (`product_id`),
1554  KEY `product_attribute_id` (`product_attribute_id`),
1555  KEY `id_tax_rules_group` (`id_tax_rules_group`),
1556  KEY `id_order_id_order_detail` (`id_order`, `id_order_detail`)
1557)
1558  ENGINE = InnoDB
1559  DEFAULT CHARSET = utf8mb4
1560  DEFAULT COLLATE utf8mb4_unicode_ci;
1561
1562CREATE TABLE `PREFIX_order_cart_rule` (
1563  `id_order_cart_rule` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
1564  `id_order`           INT(11) UNSIGNED NOT NULL,
1565  `id_cart_rule`       INT(11) UNSIGNED NOT NULL,
1566  `id_order_invoice`   INT(11) UNSIGNED          DEFAULT '0',
1567  `name`               VARCHAR(254)     NOT NULL,
1568  `value`              DECIMAL(20, 6)   NOT NULL DEFAULT 0,
1569  `value_tax_excl`     DECIMAL(20, 6)   NOT NULL DEFAULT 0,
1570  `free_shipping`      TINYINT(1)       NOT NULL DEFAULT '0',
1571  PRIMARY KEY (`id_order_cart_rule`),
1572  KEY `id_order` (`id_order`),
1573  KEY `id_cart_rule` (`id_cart_rule`)
1574)
1575  ENGINE = InnoDB
1576  DEFAULT CHARSET = utf8mb4
1577  DEFAULT COLLATE utf8mb4_unicode_ci;
1578
1579CREATE TABLE `PREFIX_order_history` (
1580  `id_order_history` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
1581  `id_employee`      INT(11) UNSIGNED NOT NULL,
1582  `id_order`         INT(11) UNSIGNED NOT NULL,
1583  `id_order_state`   INT(11) UNSIGNED NOT NULL,
1584  `date_add`         DATETIME         NOT NULL,
1585  PRIMARY KEY (`id_order_history`),
1586  KEY `order_history_order` (`id_order`),
1587  KEY `id_employee` (`id_employee`),
1588  KEY `id_order_state` (`id_order_state`)
1589)
1590  ENGINE = InnoDB
1591  DEFAULT CHARSET = utf8mb4
1592  DEFAULT COLLATE utf8mb4_unicode_ci;
1593
1594CREATE TABLE `PREFIX_order_message` (
1595  `id_order_message` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
1596  `date_add`         DATETIME         NOT NULL,
1597  PRIMARY KEY (`id_order_message`)
1598)
1599  ENGINE = InnoDB
1600  DEFAULT CHARSET = utf8mb4
1601  DEFAULT COLLATE utf8mb4_unicode_ci;
1602
1603CREATE TABLE `PREFIX_order_message_lang` (
1604  `id_order_message` INT(11) UNSIGNED NOT NULL,
1605  `id_lang`          INT(11) UNSIGNED NOT NULL,
1606  `name`             VARCHAR(128)     NOT NULL,
1607  `message`          TEXT             NOT NULL,
1608  PRIMARY KEY (`id_order_message`, `id_lang`)
1609)
1610  ENGINE = InnoDB
1611  DEFAULT CHARSET = utf8mb4
1612  DEFAULT COLLATE utf8mb4_unicode_ci;
1613
1614CREATE TABLE `PREFIX_order_return` (
1615  `id_order_return` INT(11) UNSIGNED    NOT NULL AUTO_INCREMENT,
1616  `id_customer`     INT(11) UNSIGNED    NOT NULL,
1617  `id_order`        INT(11) UNSIGNED    NOT NULL,
1618  `state`           TINYINT(1) UNSIGNED NOT NULL DEFAULT '1',
1619  `question`        TEXT                NOT NULL,
1620  `date_add`        DATETIME            NOT NULL,
1621  `date_upd`        DATETIME            NOT NULL,
1622  PRIMARY KEY (`id_order_return`),
1623  KEY `order_return_customer` (`id_customer`),
1624  KEY `id_order` (`id_order`)
1625)
1626  ENGINE = InnoDB
1627  DEFAULT CHARSET = utf8mb4
1628  DEFAULT COLLATE utf8mb4_unicode_ci;
1629
1630CREATE TABLE `PREFIX_order_return_detail` (
1631  `id_order_return`  INT(11) UNSIGNED NOT NULL,
1632  `id_order_detail`  INT(11) UNSIGNED NOT NULL,
1633  `id_customization` INT(11) UNSIGNED NOT NULL DEFAULT '0',
1634  `product_quantity` INT(11) UNSIGNED NOT NULL DEFAULT '0',
1635  PRIMARY KEY (`id_order_return`, `id_order_detail`, `id_customization`)
1636)
1637  ENGINE = InnoDB
1638  DEFAULT CHARSET = utf8mb4
1639  DEFAULT COLLATE utf8mb4_unicode_ci;
1640
1641CREATE TABLE `PREFIX_order_return_state` (
1642  `id_order_return_state`   INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
1643  `color`                   VARCHAR(32)               DEFAULT NULL,
1644  `active`                  TINYINT(1) UNSIGNED NOT NULL DEFAULT '1',
1645  PRIMARY KEY (`id_order_return_state`)
1646)
1647  ENGINE = InnoDB
1648  DEFAULT CHARSET = utf8mb4
1649  DEFAULT COLLATE utf8mb4_unicode_ci;
1650
1651CREATE TABLE `PREFIX_order_return_state_lang` (
1652  `id_order_return_state` INT(11) UNSIGNED NOT NULL,
1653  `id_lang`               INT(11) UNSIGNED NOT NULL,
1654  `name`                  VARCHAR(64)      NOT NULL,
1655  PRIMARY KEY (`id_order_return_state`, `id_lang`)
1656)
1657  ENGINE = InnoDB
1658  DEFAULT CHARSET = utf8mb4
1659  DEFAULT COLLATE utf8mb4_unicode_ci;
1660
1661
1662CREATE TABLE `PREFIX_order_slip` (
1663  `id_order_slip`           INT(11) UNSIGNED    NOT NULL AUTO_INCREMENT,
1664  `conversion_rate`         DECIMAL(13, 6)      NOT NULL DEFAULT 1,
1665  `id_customer`             INT(11) UNSIGNED    NOT NULL,
1666  `id_order`                INT(11) UNSIGNED    NOT NULL,
1667  `total_products_tax_excl` DECIMAL(20, 6)      NULL,
1668  `total_products_tax_incl` DECIMAL(20, 6)      NULL,
1669  `total_shipping_tax_excl` DECIMAL(20, 6)      NULL,
1670  `total_shipping_tax_incl` DECIMAL(20, 6)      NULL,
1671  `shipping_cost`           TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
1672  `amount`                  DECIMAL(20, 6)      NOT NULL,
1673  `shipping_cost_amount`    DECIMAL(20, 6)      NOT NULL,
1674  `partial`                 TINYINT(1)          NOT NULL,
1675  `order_slip_type`         TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
1676  `date_add`                DATETIME            NOT NULL,
1677  `date_upd`                DATETIME            NOT NULL,
1678  PRIMARY KEY (`id_order_slip`),
1679  KEY `order_slip_customer` (`id_customer`),
1680  KEY `id_order` (`id_order`)
1681)
1682  ENGINE = InnoDB
1683  DEFAULT CHARSET = utf8mb4
1684  DEFAULT COLLATE utf8mb4_unicode_ci;
1685
1686CREATE TABLE `PREFIX_order_slip_detail` (
1687  `id_order_slip`        INT(11) UNSIGNED NOT NULL,
1688  `id_order_detail`      INT(11) UNSIGNED NOT NULL,
1689  `product_quantity`     INT(11) UNSIGNED NOT NULL DEFAULT '0',
1690  `unit_price_tax_excl`  DECIMAL(20, 6)   NULL,
1691  `unit_price_tax_incl`  DECIMAL(20, 6)   NULL,
1692  `total_price_tax_excl` DECIMAL(20, 6)   NULL,
1693  `total_price_tax_incl` DECIMAL(20, 6),
1694  `amount_tax_excl`      DECIMAL(20, 6)            DEFAULT NULL,
1695  `amount_tax_incl`      DECIMAL(20, 6)            DEFAULT NULL,
1696  PRIMARY KEY (`id_order_slip`, `id_order_detail`)
1697)
1698  ENGINE = InnoDB
1699  DEFAULT CHARSET = utf8mb4
1700  DEFAULT COLLATE utf8mb4_unicode_ci;
1701
1702CREATE TABLE `PREFIX_order_state` (
1703  `id_order_state` INT(11) UNSIGNED    NOT NULL AUTO_INCREMENT,
1704  `invoice`        TINYINT(1) UNSIGNED          DEFAULT '0',
1705  `send_email`     TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
1706  `module_name`    VARCHAR(64)         NULL     DEFAULT NULL,
1707  `color`          VARCHAR(32)                  DEFAULT NULL,
1708  `unremovable`    TINYINT(1) UNSIGNED NOT NULL,
1709  `hidden`         TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
1710  `logable`        TINYINT(1)          NOT NULL DEFAULT '0',
1711  `delivery`       TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
1712  `shipped`        TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
1713  `paid`           TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
1714  `pdf_invoice`    TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
1715  `pdf_delivery`   TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
1716  `deleted`        TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
1717  `active`         TINYINT(1) UNSIGNED NOT NULL DEFAULT '1',
1718  PRIMARY KEY (`id_order_state`),
1719  KEY `module_name` (`module_name`)
1720)
1721  ENGINE = InnoDB
1722  DEFAULT CHARSET = utf8mb4
1723  DEFAULT COLLATE utf8mb4_unicode_ci;
1724
1725CREATE TABLE `PREFIX_order_state_lang` (
1726  `id_order_state` INT(11) UNSIGNED NOT NULL,
1727  `id_lang`        INT(11) UNSIGNED NOT NULL,
1728  `name`           VARCHAR(64)      NOT NULL,
1729  `template`       VARCHAR(64)      NOT NULL,
1730  PRIMARY KEY (`id_order_state`, `id_lang`)
1731)
1732  ENGINE = InnoDB
1733  DEFAULT CHARSET = utf8mb4
1734  DEFAULT COLLATE utf8mb4_unicode_ci;
1735
1736CREATE TABLE `PREFIX_pack` (
1737  `id_product_pack`           INT(11) UNSIGNED NOT NULL,
1738  `id_product_item`           INT(11) UNSIGNED NOT NULL,
1739  `id_product_attribute_item` INT(11) UNSIGNED NOT NULL,
1740  `quantity`                  INT(11) UNSIGNED NOT NULL DEFAULT 1,
1741  PRIMARY KEY (`id_product_pack`, `id_product_item`, `id_product_attribute_item`),
1742  KEY `product_item` (`id_product_item`, `id_product_attribute_item`)
1743)
1744  ENGINE = InnoDB
1745  DEFAULT CHARSET = utf8mb4
1746  DEFAULT COLLATE utf8mb4_unicode_ci;
1747
1748CREATE TABLE `PREFIX_page` (
1749  `id_page`      INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
1750  `id_page_type` INT(11) UNSIGNED NOT NULL,
1751  `id_object`    INT(11) UNSIGNED          DEFAULT NULL,
1752  PRIMARY KEY (`id_page`),
1753  KEY `id_page_type` (`id_page_type`),
1754  KEY `id_object` (`id_object`)
1755)
1756  ENGINE = InnoDB
1757  DEFAULT CHARSET = utf8mb4
1758  DEFAULT COLLATE utf8mb4_unicode_ci;
1759
1760CREATE TABLE `PREFIX_page_type` (
1761  `id_page_type` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
1762  `name`         VARCHAR(255)     NOT NULL,
1763  PRIMARY KEY (`id_page_type`)
1764)
1765  ENGINE = InnoDB
1766  DEFAULT CHARSET = utf8mb4
1767  DEFAULT COLLATE utf8mb4_unicode_ci;
1768
1769CREATE TABLE `PREFIX_page_viewed` (
1770  `id_page`       INT(11) UNSIGNED NOT NULL,
1771  `id_shop_group` INT UNSIGNED     NOT NULL DEFAULT '1',
1772  `id_shop`       INT UNSIGNED     NOT NULL DEFAULT '1',
1773  `id_date_range` INT(11) UNSIGNED NOT NULL,
1774  `counter`       INT(11) UNSIGNED NOT NULL,
1775  PRIMARY KEY (`id_page`, `id_date_range`, `id_shop`)
1776)
1777  ENGINE = InnoDB
1778  DEFAULT CHARSET = utf8mb4
1779  DEFAULT COLLATE utf8mb4_unicode_ci;
1780
1781CREATE TABLE `PREFIX_order_payment` (
1782  `id_order_payment` INT            NOT NULL AUTO_INCREMENT,
1783  `order_reference`  VARCHAR(9),
1784  `id_currency`      INT UNSIGNED   NOT NULL,
1785  `amount`           DECIMAL(20, 6) NOT NULL,
1786  `payment_method`   VARCHAR(255)   NOT NULL,
1787  `conversion_rate`  DECIMAL(13, 6) NOT NULL DEFAULT 1,
1788  `transaction_id`   VARCHAR(254)   NULL,
1789  `card_number`      VARCHAR(254)   NULL,
1790  `card_brand`       VARCHAR(254)   NULL,
1791  `card_expiration`  CHAR(7)        NULL,
1792  `card_holder`      VARCHAR(254)   NULL,
1793  `date_add`         DATETIME       NOT NULL,
1794  PRIMARY KEY (`id_order_payment`),
1795  KEY `order_reference`(`order_reference`)
1796)
1797  ENGINE = InnoDB
1798  DEFAULT CHARSET = utf8mb4
1799  DEFAULT COLLATE utf8mb4_unicode_ci;
1800
1801CREATE TABLE `PREFIX_product` (
1802  `id_product`                INT(11) UNSIGNED                           NOT NULL AUTO_INCREMENT,
1803  `id_supplier`               INT(11) UNSIGNED                                    DEFAULT NULL,
1804  `id_manufacturer`           INT(11) UNSIGNED                                    DEFAULT NULL,
1805  `id_category_default`       INT(11) UNSIGNED                                    DEFAULT NULL,
1806  `id_shop_default`           INT(11) UNSIGNED                           NOT NULL DEFAULT 1,
1807  `id_tax_rules_group`        INT(11) UNSIGNED                           NOT NULL,
1808  `on_sale`                   TINYINT(1) UNSIGNED                        NOT NULL DEFAULT '0',
1809  `online_only`               TINYINT(1) UNSIGNED                        NOT NULL DEFAULT '0',
1810  `ean13`                     VARCHAR(13)                                         DEFAULT NULL,
1811  `upc`                       VARCHAR(12)                                         DEFAULT NULL,
1812  `ecotax`                    DECIMAL(20, 6)                             NOT NULL DEFAULT 0,
1813  `quantity`                  INT(10)                                    NOT NULL DEFAULT '0',
1814  `minimal_quantity`          INT(11) UNSIGNED                           NOT NULL DEFAULT '1',
1815  `price`                     DECIMAL(20, 6)                             NOT NULL DEFAULT 0,
1816  `wholesale_price`           DECIMAL(20, 6)                             NOT NULL DEFAULT 0,
1817  `unity`                     VARCHAR(255)                                        DEFAULT NULL,
1818  `unit_price_ratio`          DECIMAL(20, 6)                             NOT NULL DEFAULT 0,
1819  `additional_shipping_cost`  DECIMAL(20, 6)                             NOT NULL DEFAULT 0,
1820  `reference`                 VARCHAR(32)                                         DEFAULT NULL,
1821  `supplier_reference`        VARCHAR(32)                                         DEFAULT NULL,
1822  `location`                  VARCHAR(64)                                         DEFAULT NULL,
1823  `width`                     DECIMAL(20, 6)                             NOT NULL DEFAULT 0,
1824  `height`                    DECIMAL(20, 6)                             NOT NULL DEFAULT 0,
1825  `depth`                     DECIMAL(20, 6)                             NOT NULL DEFAULT 0,
1826  `weight`                    DECIMAL(20, 6)                             NOT NULL DEFAULT 0,
1827  `out_of_stock`              INT(11) UNSIGNED                           NOT NULL DEFAULT '2',
1828  `quantity_discount`         TINYINT(1)                                          DEFAULT '0',
1829  `customizable`              TINYINT(2)                                 NOT NULL DEFAULT '0',
1830  `uploadable_files`          TINYINT(4)                                 NOT NULL DEFAULT '0',
1831  `text_fields`               TINYINT(4)                                 NOT NULL DEFAULT '0',
1832  `active`                    TINYINT(1) UNSIGNED                        NOT NULL DEFAULT '0',
1833  `redirect_type`             ENUM ('', '404', '301', '302')             NOT NULL DEFAULT '',
1834  `id_product_redirected`     INT(11) UNSIGNED                           NOT NULL DEFAULT '0',
1835  `available_for_order`       TINYINT(1)                                 NOT NULL DEFAULT '1',
1836  `available_date`            DATE                                       NOT NULL DEFAULT '1970-01-01',
1837  `condition`                 ENUM ('new', 'used', 'refurbished')        NOT NULL DEFAULT 'new',
1838  `show_price`                TINYINT(1)                                 NOT NULL DEFAULT '1',
1839  `indexed`                   TINYINT(1)                                 NOT NULL DEFAULT '0',
1840  `visibility`                ENUM ('both', 'catalog', 'search', 'none') NOT NULL DEFAULT 'both',
1841  `cache_is_pack`             TINYINT(1)                                 NOT NULL DEFAULT '0',
1842  `cache_has_attachments`     TINYINT(1)                                 NOT NULL DEFAULT '0',
1843  `is_virtual`                TINYINT(1)                                 NOT NULL DEFAULT '0',
1844  `cache_default_attribute`   INT(11) UNSIGNED                                    DEFAULT NULL,
1845  `date_add`                  DATETIME                                   NOT NULL,
1846  `date_upd`                  DATETIME                                   NOT NULL,
1847  `advanced_stock_management` TINYINT(1) DEFAULT '0'                     NOT NULL,
1848  `pack_stock_type`           INT(11) UNSIGNED DEFAULT '3'               NOT NULL,
1849  PRIMARY KEY (`id_product`),
1850  KEY `product_supplier` (`id_supplier`),
1851  KEY `product_manufacturer` (`id_manufacturer`, `id_product`),
1852  KEY `id_category_default` (`id_category_default`),
1853  KEY `indexed` (`indexed`),
1854  KEY `date_add` (`date_add`)
1855)
1856  ENGINE = InnoDB
1857  DEFAULT CHARSET = utf8mb4
1858  DEFAULT COLLATE utf8mb4_unicode_ci;
1859
1860CREATE TABLE IF NOT EXISTS `PREFIX_product_shop` (
1861  `id_product`                INT(11) UNSIGNED                           NOT NULL,
1862  `id_shop`                   INT(11) UNSIGNED                           NOT NULL,
1863  `id_category_default`       INT(11) UNSIGNED                                    DEFAULT NULL,
1864  `id_tax_rules_group`        INT(11) UNSIGNED                           NOT NULL,
1865  `on_sale`                   TINYINT(1) UNSIGNED                        NOT NULL DEFAULT '0',
1866  `online_only`               TINYINT(1) UNSIGNED                        NOT NULL DEFAULT '0',
1867  `ecotax`                    DECIMAL(20, 6)                             NOT NULL DEFAULT 0,
1868  `minimal_quantity`          INT(11) UNSIGNED                           NOT NULL DEFAULT '1',
1869  `price`                     DECIMAL(20, 6)                             NOT NULL DEFAULT 0,
1870  `wholesale_price`           DECIMAL(20, 6)                             NOT NULL DEFAULT 0,
1871  `unity`                     VARCHAR(255)                                        DEFAULT NULL,
1872  `unit_price_ratio`          DECIMAL(20, 6)                             NOT NULL DEFAULT 0,
1873  `additional_shipping_cost`  DECIMAL(20, 6)                             NOT NULL DEFAULT 0,
1874  `customizable`              TINYINT(2)                                 NOT NULL DEFAULT '0',
1875  `uploadable_files`          TINYINT(4)                                 NOT NULL DEFAULT '0',
1876  `text_fields`               TINYINT(4)                                 NOT NULL DEFAULT '0',
1877  `active`                    TINYINT(1) UNSIGNED                        NOT NULL DEFAULT '0',
1878  `redirect_type`             ENUM ('', '404', '301', '302')             NOT NULL DEFAULT '',
1879  `id_product_redirected`     INT(11) UNSIGNED                           NOT NULL DEFAULT '0',
1880  `available_for_order`       TINYINT(1)                                 NOT NULL DEFAULT '1',
1881  `available_date`            DATE                                       NOT NULL DEFAULT '1970-01-01',
1882  `condition`                 ENUM ('new', 'used', 'refurbished')        NOT NULL DEFAULT 'new',
1883  `show_price`                TINYINT(1)                                 NOT NULL DEFAULT '1',
1884  `indexed`                   TINYINT(1)                                 NOT NULL DEFAULT '0',
1885  `visibility`                ENUM ('both', 'catalog', 'search', 'none') NOT NULL DEFAULT 'both',
1886  `cache_default_attribute`   INT(11) UNSIGNED                                    DEFAULT NULL,
1887  `advanced_stock_management` TINYINT(1) DEFAULT '0'                     NOT NULL,
1888  `date_add`                  DATETIME                                   NOT NULL,
1889  `date_upd`                  DATETIME                                   NOT NULL,
1890  `pack_stock_type`           INT(11) UNSIGNED DEFAULT '3'               NOT NULL,
1891  PRIMARY KEY (`id_product`, `id_shop`),
1892  KEY `id_category_default` (`id_category_default`),
1893  KEY `date_add` (`date_add`, `active`, `visibility`),
1894  KEY `indexed` (`indexed`, `active`, `id_product`)
1895)
1896  ENGINE = InnoDB
1897  DEFAULT CHARSET = utf8mb4
1898  DEFAULT COLLATE utf8mb4_unicode_ci;
1899
1900CREATE TABLE `PREFIX_product_attribute` (
1901  `id_product_attribute` INT(11) UNSIGNED    NOT NULL AUTO_INCREMENT,
1902  `id_product`           INT(11) UNSIGNED    NOT NULL,
1903  `reference`            VARCHAR(32)                  DEFAULT NULL,
1904  `supplier_reference`   VARCHAR(32)                  DEFAULT NULL,
1905  `location`             VARCHAR(64)                  DEFAULT NULL,
1906  `ean13`                VARCHAR(13)                  DEFAULT NULL,
1907  `upc`                  VARCHAR(12)                  DEFAULT NULL,
1908  `wholesale_price`      DECIMAL(20, 6)      NOT NULL DEFAULT 0,
1909  `price`                DECIMAL(20, 6)      NOT NULL DEFAULT 0,
1910  `ecotax`               DECIMAL(20, 6)      NOT NULL DEFAULT 0,
1911  `quantity`             INT(10)             NOT NULL DEFAULT '0',
1912  `weight`               DECIMAL(20, 6)      NOT NULL DEFAULT 0,
1913  `unit_price_impact`    DECIMAL(20, 6)      NOT NULL DEFAULT 0,
1914  `default_on`           TINYINT(1) UNSIGNED NULL     DEFAULT NULL,
1915  `minimal_quantity`     INT(11) UNSIGNED    NOT NULL DEFAULT '1',
1916  `available_date`       DATE                NOT NULL DEFAULT '1970-01-01',
1917  PRIMARY KEY (`id_product_attribute`),
1918  KEY `product_attribute_product` (`id_product`),
1919  KEY `reference` (`reference`),
1920  KEY `supplier_reference` (`supplier_reference`),
1921  UNIQUE KEY `product_default` (`id_product`, `default_on`),
1922  KEY `id_product_id_product_attribute` (`id_product_attribute`, `id_product`)
1923)
1924  ENGINE = InnoDB
1925  DEFAULT CHARSET = utf8mb4
1926  DEFAULT COLLATE utf8mb4_unicode_ci;
1927
1928CREATE TABLE `PREFIX_product_attribute_shop` (
1929  `id_product`           INT(11) UNSIGNED    NOT NULL,
1930  `id_product_attribute` INT(11) UNSIGNED    NOT NULL,
1931  `id_shop`              INT(11) UNSIGNED    NOT NULL,
1932  `wholesale_price`      DECIMAL(20, 6)      NOT NULL DEFAULT 0,
1933  `price`                DECIMAL(20, 6)      NOT NULL DEFAULT 0,
1934  `ecotax`               DECIMAL(20, 6)      NOT NULL DEFAULT 0,
1935  `weight`               DECIMAL(20, 6)      NOT NULL DEFAULT 0,
1936  `unit_price_impact`    DECIMAL(20, 6)      NOT NULL DEFAULT 0,
1937  `default_on`           TINYINT(1) UNSIGNED NULL     DEFAULT NULL,
1938  `minimal_quantity`     INT(11) UNSIGNED    NOT NULL DEFAULT '1',
1939  `available_date`       DATE                NOT NULL DEFAULT '1970-01-01',
1940  PRIMARY KEY (`id_product_attribute`, `id_shop`),
1941  UNIQUE KEY `id_product` (`id_product`, `id_shop`, `default_on`)
1942)
1943  ENGINE = InnoDB
1944  DEFAULT CHARSET = utf8mb4
1945  DEFAULT COLLATE utf8mb4_unicode_ci;
1946
1947CREATE TABLE `PREFIX_product_attribute_combination` (
1948  `id_attribute`         INT(11) UNSIGNED NOT NULL,
1949  `id_product_attribute` INT(11) UNSIGNED NOT NULL,
1950  PRIMARY KEY (`id_attribute`, `id_product_attribute`),
1951  KEY `id_product_attribute` (`id_product_attribute`)
1952)
1953  ENGINE = InnoDB
1954  DEFAULT CHARSET = utf8mb4
1955  DEFAULT COLLATE utf8mb4_unicode_ci;
1956
1957CREATE TABLE `PREFIX_product_attribute_image` (
1958  `id_product_attribute` INT(11) UNSIGNED NOT NULL,
1959  `id_image`             INT(11) UNSIGNED NOT NULL,
1960  PRIMARY KEY (`id_product_attribute`, `id_image`),
1961  KEY `id_image` (`id_image`)
1962)
1963  ENGINE = InnoDB
1964  DEFAULT CHARSET = utf8mb4
1965  DEFAULT COLLATE utf8mb4_unicode_ci;
1966
1967CREATE TABLE `PREFIX_product_download` (
1968  `id_product_download` INT(11) UNSIGNED    NOT NULL AUTO_INCREMENT,
1969  `id_product`          INT(11) UNSIGNED    NOT NULL,
1970  `display_filename`    VARCHAR(255)                 DEFAULT NULL,
1971  `filename`            VARCHAR(255)                 DEFAULT NULL,
1972  `date_add`            DATETIME            NOT NULL,
1973  `date_expiration`     DATETIME                     DEFAULT NULL,
1974  `nb_days_accessible`  INT(11) UNSIGNED             DEFAULT NULL,
1975  `nb_downloadable`     INT(11) UNSIGNED             DEFAULT '1',
1976  `active`              TINYINT(1) UNSIGNED NOT NULL DEFAULT '1',
1977  `is_shareable`        TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
1978  PRIMARY KEY (`id_product_download`),
1979  KEY `product_active` (`id_product`, `active`),
1980  UNIQUE KEY `id_product` (`id_product`)
1981)
1982  ENGINE = InnoDB
1983  DEFAULT CHARSET = utf8mb4
1984  DEFAULT COLLATE utf8mb4_unicode_ci;
1985
1986CREATE TABLE `PREFIX_product_lang` (
1987  `id_product`        INT(11) UNSIGNED NOT NULL,
1988  `id_shop`           INT(11) UNSIGNED NOT NULL DEFAULT '1',
1989  `id_lang`           INT(11) UNSIGNED NOT NULL,
1990  `description`       TEXT,
1991  `description_short` TEXT,
1992  `link_rewrite`      VARCHAR(128)     NOT NULL,
1993  `meta_description`  VARCHAR(255)              DEFAULT NULL,
1994  `meta_keywords`     VARCHAR(255)              DEFAULT NULL,
1995  `meta_title`        VARCHAR(128)              DEFAULT NULL,
1996  `name`              VARCHAR(128)     NOT NULL,
1997  `available_now`     VARCHAR(255)              DEFAULT NULL,
1998  `available_later`   VARCHAR(255)              DEFAULT NULL,
1999  PRIMARY KEY (`id_product`, `id_shop`, `id_lang`),
2000  KEY `id_lang` (`id_lang`),
2001  KEY `name` (`name`)
2002)
2003  ENGINE = InnoDB
2004  DEFAULT CHARSET = utf8mb4
2005  DEFAULT COLLATE utf8mb4_unicode_ci;
2006
2007CREATE TABLE `PREFIX_product_sale` (
2008  `id_product` INT(11) UNSIGNED NOT NULL,
2009  `quantity`   INT(11) UNSIGNED NOT NULL DEFAULT '0',
2010  `sale_nbr`   INT(11) UNSIGNED NOT NULL DEFAULT '0',
2011  `date_upd`   DATE             NOT NULL,
2012  PRIMARY KEY (`id_product`),
2013  KEY `quantity` (`quantity`)
2014)
2015  ENGINE = InnoDB
2016  DEFAULT CHARSET = utf8mb4
2017  DEFAULT COLLATE utf8mb4_unicode_ci;
2018
2019CREATE TABLE `PREFIX_product_tag` (
2020  `id_product` INT(11) UNSIGNED NOT NULL,
2021  `id_tag`     INT(11) UNSIGNED NOT NULL,
2022  `id_lang`    INT(11) UNSIGNED NOT NULL,
2023  PRIMARY KEY (`id_product`, `id_tag`),
2024  KEY `id_tag` (`id_tag`),
2025  KEY `id_lang` (`id_lang`, `id_tag`)
2026)
2027  ENGINE = InnoDB
2028  DEFAULT CHARSET = utf8mb4
2029  DEFAULT COLLATE utf8mb4_unicode_ci;
2030
2031CREATE TABLE `PREFIX_profile` (
2032  `id_profile` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
2033  PRIMARY KEY (`id_profile`)
2034)
2035  ENGINE = InnoDB
2036  DEFAULT CHARSET = utf8mb4
2037  DEFAULT COLLATE utf8mb4_unicode_ci;
2038
2039CREATE TABLE `PREFIX_profile_lang` (
2040  `id_lang`    INT(11) UNSIGNED NOT NULL,
2041  `id_profile` INT(11) UNSIGNED NOT NULL,
2042  `name`       VARCHAR(128)     NOT NULL,
2043  PRIMARY KEY (`id_profile`, `id_lang`)
2044)
2045  ENGINE = InnoDB
2046  DEFAULT CHARSET = utf8mb4
2047  DEFAULT COLLATE utf8mb4_unicode_ci;
2048
2049CREATE TABLE `PREFIX_quick_access` (
2050  `id_quick_access` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
2051  `new_window`      TINYINT(1)       NOT NULL DEFAULT '0',
2052  `link`            VARCHAR(255)     NOT NULL,
2053  PRIMARY KEY (`id_quick_access`)
2054)
2055  ENGINE = InnoDB
2056  DEFAULT CHARSET = utf8mb4
2057  DEFAULT COLLATE utf8mb4_unicode_ci;
2058
2059CREATE TABLE `PREFIX_quick_access_lang` (
2060  `id_quick_access` INT(11) UNSIGNED NOT NULL,
2061  `id_lang`         INT(11) UNSIGNED NOT NULL,
2062  `name`            VARCHAR(32)      NOT NULL,
2063  PRIMARY KEY (`id_quick_access`, `id_lang`)
2064)
2065  ENGINE = InnoDB
2066  DEFAULT CHARSET = utf8mb4
2067  DEFAULT COLLATE utf8mb4_unicode_ci;
2068
2069CREATE TABLE `PREFIX_range_price` (
2070  `id_range_price` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
2071  `id_carrier`     INT(11) UNSIGNED NOT NULL,
2072  `delimiter1`     DECIMAL(20, 6)   NOT NULL,
2073  `delimiter2`     DECIMAL(20, 6)   NOT NULL,
2074  PRIMARY KEY (`id_range_price`),
2075  UNIQUE KEY `id_carrier` (`id_carrier`, `delimiter1`, `delimiter2`)
2076)
2077  ENGINE = InnoDB
2078  DEFAULT CHARSET = utf8mb4
2079  DEFAULT COLLATE utf8mb4_unicode_ci;
2080
2081CREATE TABLE `PREFIX_range_weight` (
2082  `id_range_weight` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
2083  `id_carrier`      INT(11) UNSIGNED NOT NULL,
2084  `delimiter1`      DECIMAL(20, 6)   NOT NULL,
2085  `delimiter2`      DECIMAL(20, 6)   NOT NULL,
2086  PRIMARY KEY (`id_range_weight`),
2087  UNIQUE KEY `id_carrier` (`id_carrier`, `delimiter1`, `delimiter2`)
2088)
2089  ENGINE = InnoDB
2090  DEFAULT CHARSET = utf8mb4
2091  DEFAULT COLLATE utf8mb4_unicode_ci;
2092
2093CREATE TABLE `PREFIX_referrer` (
2094  `id_referrer`             INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
2095  `name`                    VARCHAR(64)      NOT NULL,
2096  `passwd`                  VARCHAR(60)               DEFAULT NULL,
2097  `http_referer_regexp`     VARCHAR(64)               DEFAULT NULL,
2098  `http_referer_like`       VARCHAR(64)               DEFAULT NULL,
2099  `request_uri_regexp`      VARCHAR(64)               DEFAULT NULL,
2100  `request_uri_like`        VARCHAR(64)               DEFAULT NULL,
2101  `http_referer_regexp_not` VARCHAR(64)               DEFAULT NULL,
2102  `http_referer_like_not`   VARCHAR(64)               DEFAULT NULL,
2103  `request_uri_regexp_not`  VARCHAR(64)               DEFAULT NULL,
2104  `request_uri_like_not`    VARCHAR(64)               DEFAULT NULL,
2105  `base_fee`                DECIMAL(20, 6)   NOT NULL DEFAULT 0,
2106  `percent_fee`             DECIMAL(5, 2)    NOT NULL DEFAULT 0,
2107  `click_fee`               DECIMAL(20, 6)   NOT NULL DEFAULT 0,
2108  `date_add`                DATETIME         NOT NULL,
2109  PRIMARY KEY (`id_referrer`)
2110)
2111  ENGINE = InnoDB
2112  DEFAULT CHARSET = utf8mb4
2113  DEFAULT COLLATE utf8mb4_unicode_ci;
2114
2115CREATE TABLE `PREFIX_referrer_cache` (
2116  `id_connections_source` INT(11) UNSIGNED NOT NULL,
2117  `id_referrer`           INT(11) UNSIGNED NOT NULL,
2118  PRIMARY KEY (`id_connections_source`, `id_referrer`)
2119)
2120  ENGINE = InnoDB
2121  DEFAULT CHARSET = utf8mb4
2122  DEFAULT COLLATE utf8mb4_unicode_ci;
2123
2124CREATE TABLE `PREFIX_referrer_shop` (
2125  `id_referrer`         INT(11) UNSIGNED NOT NULL,
2126  `id_shop`             INT(11) UNSIGNED NOT NULL,
2127  `cache_visitors`      INT(11)                   DEFAULT NULL,
2128  `cache_visits`        INT(11)                   DEFAULT NULL,
2129  `cache_pages`         INT(11)                   DEFAULT NULL,
2130  `cache_registrations` INT(11)                   DEFAULT NULL,
2131  `cache_orders`        INT(11)                   DEFAULT NULL,
2132  `cache_sales`         DECIMAL(17, 2)            DEFAULT NULL,
2133  `cache_reg_rate`      DECIMAL(5, 4)             DEFAULT NULL,
2134  `cache_order_rate`    DECIMAL(5, 4)             DEFAULT NULL,
2135  PRIMARY KEY (`id_referrer`, `id_shop`)
2136)
2137  ENGINE = InnoDB
2138  DEFAULT CHARSET = utf8mb4
2139  DEFAULT COLLATE utf8mb4_unicode_ci;
2140
2141CREATE TABLE IF NOT EXISTS `PREFIX_request_sql` (
2142  `id_request_sql` INT(11)      NOT NULL AUTO_INCREMENT,
2143  `name`           VARCHAR(200) NOT NULL,
2144  `sql`            TEXT         NOT NULL,
2145  PRIMARY KEY (`id_request_sql`)
2146)
2147  ENGINE = InnoDB
2148  DEFAULT CHARSET = utf8mb4
2149  DEFAULT COLLATE utf8mb4_unicode_ci;
2150
2151CREATE TABLE `PREFIX_scene` (
2152  `id_scene` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
2153  `active`   TINYINT(1)       NOT NULL DEFAULT '1',
2154  PRIMARY KEY (`id_scene`)
2155)
2156  ENGINE = InnoDB
2157  DEFAULT CHARSET = utf8mb4
2158  DEFAULT COLLATE utf8mb4_unicode_ci;
2159
2160CREATE TABLE `PREFIX_scene_category` (
2161  `id_scene`    INT(11) UNSIGNED NOT NULL,
2162  `id_category` INT(11) UNSIGNED NOT NULL,
2163  PRIMARY KEY (`id_scene`, `id_category`)
2164)
2165  ENGINE = InnoDB
2166  DEFAULT CHARSET = utf8mb4
2167  DEFAULT COLLATE utf8mb4_unicode_ci;
2168
2169CREATE TABLE `PREFIX_scene_lang` (
2170  `id_scene` INT(11) UNSIGNED NOT NULL,
2171  `id_lang`  INT(11) UNSIGNED NOT NULL,
2172  `name`     VARCHAR(100)     NOT NULL,
2173  PRIMARY KEY (`id_scene`, `id_lang`)
2174)
2175  ENGINE = InnoDB
2176  DEFAULT CHARSET = utf8mb4
2177  DEFAULT COLLATE utf8mb4_unicode_ci;
2178
2179CREATE TABLE `PREFIX_scene_products` (
2180  `id_scene`    INT(11) UNSIGNED NOT NULL,
2181  `id_product`  INT(11) UNSIGNED NOT NULL,
2182  `x_axis`      INT(4)           NOT NULL,
2183  `y_axis`      INT(4)           NOT NULL,
2184  `zone_width`  INT(3)           NOT NULL,
2185  `zone_height` INT(3)           NOT NULL,
2186  PRIMARY KEY (`id_scene`, `id_product`, `x_axis`, `y_axis`)
2187)
2188  ENGINE = InnoDB
2189  DEFAULT CHARSET = utf8mb4
2190  DEFAULT COLLATE utf8mb4_unicode_ci;
2191
2192CREATE TABLE `PREFIX_search_engine` (
2193  `id_search_engine` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
2194  `server`           VARCHAR(64)      NOT NULL,
2195  `getvar`           VARCHAR(16)      NOT NULL,
2196  PRIMARY KEY (`id_search_engine`)
2197)
2198  ENGINE = InnoDB
2199  DEFAULT CHARSET = utf8mb4
2200  DEFAULT COLLATE utf8mb4_unicode_ci;
2201
2202CREATE TABLE `PREFIX_search_index` (
2203  `id_product` INT(11) UNSIGNED     NOT NULL,
2204  `id_word`    INT(11) UNSIGNED     NOT NULL,
2205  `weight`     SMALLINT(4) UNSIGNED NOT NULL DEFAULT 1,
2206  PRIMARY KEY (`id_word`, `id_product`),
2207  KEY `id_product` (`id_product`)
2208)
2209  ENGINE = InnoDB
2210  DEFAULT CHARSET = utf8mb4
2211  DEFAULT COLLATE utf8mb4_unicode_ci;
2212
2213CREATE TABLE `PREFIX_search_word` (
2214  `id_word` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
2215  `id_shop` INT(11) UNSIGNED NOT NULL DEFAULT 1,
2216  `id_lang` INT(11) UNSIGNED NOT NULL,
2217  `word`    VARCHAR(15)      NOT NULL,
2218  PRIMARY KEY (`id_word`),
2219  UNIQUE KEY `id_lang` (`id_lang`, `id_shop`, `word`)
2220)
2221  ENGINE = InnoDB
2222  DEFAULT CHARSET = utf8mb4
2223  DEFAULT COLLATE utf8mb4_unicode_ci;
2224
2225CREATE TABLE `PREFIX_specific_price` (
2226  `id_specific_price`      INT UNSIGNED                  NOT NULL AUTO_INCREMENT,
2227  `id_specific_price_rule` INT(11) UNSIGNED              NOT NULL,
2228  `id_cart`                INT(11) UNSIGNED              NOT NULL,
2229  `id_product`             INT UNSIGNED                  NOT NULL,
2230  `id_shop`                INT(11) UNSIGNED              NOT NULL DEFAULT '1',
2231  `id_shop_group`          INT(11) UNSIGNED              NOT NULL,
2232  `id_currency`            INT UNSIGNED                  NOT NULL,
2233  `id_country`             INT UNSIGNED                  NOT NULL,
2234  `id_group`               INT UNSIGNED                  NOT NULL,
2235  `id_customer`            INT UNSIGNED                  NOT NULL,
2236  `id_product_attribute`   INT UNSIGNED                  NOT NULL,
2237  `price`                  DECIMAL(20, 6)                NOT NULL,
2238  `from_quantity`          MEDIUMINT(8) UNSIGNED         NOT NULL,
2239  `reduction`              DECIMAL(20, 6)                NOT NULL,
2240  `reduction_tax`          TINYINT(1)                    NOT NULL DEFAULT 1,
2241  `reduction_type`         ENUM ('amount', 'percentage') NOT NULL,
2242  `from`                   DATETIME                      NOT NULL,
2243  `to`                     DATETIME                      NOT NULL,
2244  PRIMARY KEY (`id_specific_price`),
2245  KEY (`id_product`, `id_shop`, `id_currency`, `id_country`, `id_group`, `id_customer`, `from_quantity`, `from`, `to`),
2246  KEY `from_quantity` (`from_quantity`),
2247  KEY (`id_specific_price_rule`),
2248  KEY (`id_cart`),
2249  KEY `id_product_attribute` (`id_product_attribute`),
2250  KEY `id_shop` (`id_shop`),
2251  KEY `id_customer` (`id_customer`),
2252  KEY `from` (`from`),
2253  KEY `to` (`to`),
2254  UNIQUE KEY `id_product_2` (`id_product`, `id_product_attribute`, `id_customer`, `id_cart`, `from`, `to`, `id_shop`, `id_shop_group`, `id_currency`, `id_country`, `id_group`, `from_quantity`, `id_specific_price_rule`)
2255)
2256  ENGINE = InnoDB
2257  DEFAULT CHARSET = utf8mb4
2258  DEFAULT COLLATE utf8mb4_unicode_ci;
2259
2260CREATE TABLE `PREFIX_state` (
2261  `id_state`     INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
2262  `id_country`   INT(11) UNSIGNED NOT NULL,
2263  `id_zone`      INT(11) UNSIGNED NOT NULL,
2264  `name`         VARCHAR(64)      NOT NULL,
2265  `iso_code`     VARCHAR(7)       NOT NULL,
2266  `tax_behavior` SMALLINT(1)      NOT NULL DEFAULT '0',
2267  `active`       TINYINT(1)       NOT NULL DEFAULT '0',
2268  PRIMARY KEY (`id_state`),
2269  KEY `id_country` (`id_country`),
2270  KEY `name` (`name`),
2271  KEY `id_zone` (`id_zone`)
2272)
2273  ENGINE = InnoDB
2274  DEFAULT CHARSET = utf8mb4
2275  DEFAULT COLLATE utf8mb4_unicode_ci;
2276
2277
2278CREATE TABLE `PREFIX_supplier` (
2279  `id_supplier` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
2280  `name`        VARCHAR(64)      NOT NULL,
2281  `date_add`    DATETIME         NOT NULL,
2282  `date_upd`    DATETIME         NOT NULL,
2283  `active`      TINYINT(1)       NOT NULL DEFAULT '0',
2284  PRIMARY KEY (`id_supplier`)
2285)
2286  ENGINE = InnoDB
2287  DEFAULT CHARSET = utf8mb4
2288  DEFAULT COLLATE utf8mb4_unicode_ci;
2289
2290CREATE TABLE `PREFIX_supplier_lang` (
2291  `id_supplier`      INT(11) UNSIGNED NOT NULL,
2292  `id_lang`          INT(11) UNSIGNED NOT NULL,
2293  `description`      TEXT,
2294  `meta_title`       VARCHAR(128) DEFAULT NULL,
2295  `meta_keywords`    VARCHAR(255) DEFAULT NULL,
2296  `meta_description` VARCHAR(255) DEFAULT NULL,
2297  PRIMARY KEY (`id_supplier`, `id_lang`)
2298)
2299  ENGINE = InnoDB
2300  DEFAULT CHARSET = utf8mb4
2301  DEFAULT COLLATE utf8mb4_unicode_ci;
2302
2303CREATE TABLE `PREFIX_tab` (
2304  `id_tab`         INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
2305  `id_parent`      INT(11)          NOT NULL,
2306  `class_name`     VARCHAR(64)      NOT NULL,
2307  `module`         VARCHAR(64)      NULL,
2308  `position`       INT(11) UNSIGNED NOT NULL,
2309  `active`         TINYINT(1)       NOT NULL DEFAULT '1',
2310  `hide_host_mode` TINYINT(1)       NOT NULL DEFAULT '0',
2311  PRIMARY KEY (`id_tab`),
2312  KEY `class_name` (`class_name`),
2313  KEY `id_parent` (`id_parent`)
2314)
2315  ENGINE = InnoDB
2316  DEFAULT CHARSET = utf8mb4
2317  DEFAULT COLLATE utf8mb4_unicode_ci;
2318
2319CREATE TABLE `PREFIX_tab_lang` (
2320  `id_tab`  INT(11) UNSIGNED NOT NULL,
2321  `id_lang` INT(11) UNSIGNED NOT NULL,
2322  `name`    VARCHAR(64) DEFAULT NULL,
2323  PRIMARY KEY (`id_tab`, `id_lang`)
2324)
2325  ENGINE = InnoDB
2326  DEFAULT CHARSET = utf8mb4
2327  DEFAULT COLLATE utf8mb4_unicode_ci;
2328
2329CREATE TABLE `PREFIX_tag` (
2330  `id_tag`  INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
2331  `id_lang` INT(11) UNSIGNED NOT NULL,
2332  `name`    VARCHAR(32)      NOT NULL,
2333  PRIMARY KEY (`id_tag`),
2334  KEY `tag_name` (`name`),
2335  KEY `id_lang` (`id_lang`)
2336)
2337  ENGINE = InnoDB
2338  DEFAULT CHARSET = utf8mb4
2339  DEFAULT COLLATE utf8mb4_unicode_ci;
2340
2341CREATE TABLE `PREFIX_tag_count` (
2342  `id_group` INT(11) UNSIGNED NOT NULL DEFAULT 0,
2343  `id_tag`   INT(11) UNSIGNED NOT NULL DEFAULT 0,
2344  `id_lang`  INT(11) UNSIGNED NOT NULL DEFAULT 0,
2345  `id_shop`  INT(11) UNSIGNED NOT NULL DEFAULT 0,
2346  `counter`  INT(11) UNSIGNED NOT NULL DEFAULT 0,
2347  PRIMARY KEY (`id_group`, `id_tag`),
2348  KEY (`id_group`, `id_lang`, `id_shop`, `counter`)
2349)
2350  ENGINE = InnoDB
2351  DEFAULT CHARSET = utf8mb4
2352  DEFAULT COLLATE utf8mb4_unicode_ci;
2353
2354CREATE TABLE `PREFIX_tax` (
2355  `id_tax`  INT(11) UNSIGNED    NOT NULL AUTO_INCREMENT,
2356  `rate`    DECIMAL(10, 3)      NOT NULL,
2357  `active`  TINYINT(1) UNSIGNED NOT NULL DEFAULT '1',
2358  `deleted` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
2359  PRIMARY KEY (`id_tax`)
2360)
2361  ENGINE = InnoDB
2362  DEFAULT CHARSET = utf8mb4
2363  DEFAULT COLLATE utf8mb4_unicode_ci;
2364
2365CREATE TABLE `PREFIX_tax_lang` (
2366  `id_tax`  INT(11) UNSIGNED NOT NULL,
2367  `id_lang` INT(11) UNSIGNED NOT NULL,
2368  `name`    VARCHAR(32)      NOT NULL,
2369  PRIMARY KEY (`id_tax`, `id_lang`)
2370)
2371  ENGINE = InnoDB
2372  DEFAULT CHARSET = utf8mb4
2373  DEFAULT COLLATE utf8mb4_unicode_ci;
2374
2375CREATE TABLE `PREFIX_timezone` (
2376  id_timezone INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
2377  name        VARCHAR(32)      NOT NULL,
2378  PRIMARY KEY (`id_timezone`)
2379)
2380  ENGINE = InnoDB
2381  DEFAULT CHARSET = utf8mb4
2382  DEFAULT COLLATE utf8mb4_unicode_ci;
2383
2384CREATE TABLE `PREFIX_web_browser` (
2385  `id_web_browser` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
2386  `name`           VARCHAR(64)               DEFAULT NULL,
2387  PRIMARY KEY (`id_web_browser`)
2388)
2389  ENGINE = InnoDB
2390  DEFAULT CHARSET = utf8mb4
2391  DEFAULT COLLATE utf8mb4_unicode_ci;
2392
2393CREATE TABLE `PREFIX_zone` (
2394  `id_zone` INT(11) UNSIGNED    NOT NULL AUTO_INCREMENT,
2395  `name`    VARCHAR(64)         NOT NULL,
2396  `active`  TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
2397  PRIMARY KEY (`id_zone`)
2398)
2399  ENGINE = InnoDB
2400  DEFAULT CHARSET = utf8mb4
2401  DEFAULT COLLATE utf8mb4_unicode_ci;
2402
2403CREATE TABLE `PREFIX_carrier_group` (
2404  `id_carrier` INT(11) UNSIGNED NOT NULL,
2405  `id_group`   INT(11) UNSIGNED NOT NULL,
2406  PRIMARY KEY (`id_carrier`, `id_group`)
2407)
2408  ENGINE = InnoDB
2409  DEFAULT CHARSET = utf8mb4
2410  DEFAULT COLLATE utf8mb4_unicode_ci;
2411
2412CREATE TABLE `PREFIX_store` (
2413  `id_store`   INT(11) UNSIGNED    NOT NULL AUTO_INCREMENT,
2414  `id_country` INT(11) UNSIGNED    NOT NULL,
2415  `id_state`   INT(11) UNSIGNED             DEFAULT NULL,
2416  `name`       VARCHAR(128)        NOT NULL,
2417  `address1`   VARCHAR(128)        NOT NULL,
2418  `address2`   VARCHAR(128)                 DEFAULT NULL,
2419  `city`       VARCHAR(64)         NOT NULL,
2420  `postcode`   VARCHAR(12)         NOT NULL,
2421  `latitude`   DECIMAL(13, 8)               DEFAULT NULL,
2422  `longitude`  DECIMAL(13, 8)               DEFAULT NULL,
2423  `hours`      VARCHAR(254)                 DEFAULT NULL,
2424  `phone`      VARCHAR(16)                  DEFAULT NULL,
2425  `fax`        VARCHAR(16)                  DEFAULT NULL,
2426  `email`      VARCHAR(128)                 DEFAULT NULL,
2427  `note`       TEXT,
2428  `active`     TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
2429  `date_add`   DATETIME            NOT NULL,
2430  `date_upd`   DATETIME            NOT NULL,
2431  PRIMARY KEY (`id_store`)
2432)
2433  ENGINE = InnoDB
2434  DEFAULT CHARSET = utf8mb4
2435  DEFAULT COLLATE utf8mb4_unicode_ci;
2436
2437CREATE TABLE `PREFIX_webservice_account` (
2438  `id_webservice_account` INT(11)     NOT NULL AUTO_INCREMENT,
2439  `key`                   VARCHAR(32) NOT NULL,
2440  `description`           TEXT        NULL,
2441  `class_name`            VARCHAR(50) NOT NULL DEFAULT 'WebserviceRequest',
2442  `is_module`             TINYINT(2)  NOT NULL DEFAULT '0',
2443  `module_name`           VARCHAR(50) NULL     DEFAULT NULL,
2444  `active`                TINYINT(2)  NOT NULL,
2445  PRIMARY KEY (`id_webservice_account`),
2446  KEY `key` (`key`)
2447)
2448  ENGINE = InnoDB
2449  DEFAULT CHARSET = utf8mb4
2450  DEFAULT COLLATE utf8mb4_unicode_ci;
2451
2452CREATE TABLE `PREFIX_webservice_permission` (
2453  `id_webservice_permission` INT(11)                                       NOT NULL AUTO_INCREMENT,
2454  `resource`                 VARCHAR(50)                                   NOT NULL,
2455  `method`                   ENUM ('GET', 'POST', 'PUT', 'DELETE', 'HEAD') NOT NULL,
2456  `id_webservice_account`    INT(11)                                       NOT NULL,
2457  PRIMARY KEY (`id_webservice_permission`),
2458  UNIQUE KEY `resource_2` (`resource`, `method`, `id_webservice_account`),
2459  KEY `resource` (`resource`),
2460  KEY `method` (`method`),
2461  KEY `id_webservice_account` (`id_webservice_account`)
2462)
2463  ENGINE = InnoDB
2464  DEFAULT CHARSET = utf8mb4
2465  DEFAULT COLLATE utf8mb4_unicode_ci;
2466
2467CREATE TABLE `PREFIX_required_field` (
2468  `id_required_field` INT(11)     NOT NULL AUTO_INCREMENT,
2469  `object_name`       VARCHAR(32) NOT NULL,
2470  `field_name`        VARCHAR(32) NOT NULL,
2471  PRIMARY KEY (`id_required_field`),
2472  KEY `object_name` (`object_name`)
2473)
2474  ENGINE = InnoDB
2475  DEFAULT CHARSET = utf8mb4
2476  DEFAULT COLLATE utf8mb4_unicode_ci;
2477
2478CREATE TABLE `PREFIX_memcached_servers` (
2479  `id_memcached_server` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
2480  `ip`                  VARCHAR(254)     NOT NULL,
2481  `port`                INT(11) UNSIGNED NOT NULL,
2482  `weight`              INT(11) UNSIGNED NOT NULL
2483)
2484  ENGINE = InnoDB
2485  DEFAULT CHARSET = utf8mb4
2486  DEFAULT COLLATE utf8mb4_unicode_ci;
2487
2488CREATE TABLE `PREFIX_product_country_tax` (
2489  `id_product` INT(11) NOT NULL,
2490  `id_country` INT(11) NOT NULL,
2491  `id_tax`     INT(11) NOT NULL,
2492  PRIMARY KEY (`id_product`, `id_country`)
2493)
2494  ENGINE = InnoDB
2495  DEFAULT CHARSET = utf8mb4
2496  DEFAULT COLLATE utf8mb4_unicode_ci;
2497
2498CREATE TABLE `PREFIX_tax_rule` (
2499  `id_tax_rule`        INT(11)      NOT NULL AUTO_INCREMENT,
2500  `id_tax_rules_group` INT(11)      NOT NULL,
2501  `id_country`         INT(11)      NOT NULL,
2502  `id_state`           INT(11)      NOT NULL,
2503  `zipcode_from`       VARCHAR(12)  NOT NULL,
2504  `zipcode_to`         VARCHAR(12)  NOT NULL,
2505  `id_tax`             INT(11)      NOT NULL,
2506  `behavior`           INT(11)      NOT NULL,
2507  `description`        VARCHAR(100) NOT NULL,
2508  PRIMARY KEY (`id_tax_rule`),
2509  KEY `id_tax_rules_group` (`id_tax_rules_group`),
2510  KEY `id_tax` (`id_tax`),
2511  KEY `category_getproducts` (`id_tax_rules_group`, `id_country`, `id_state`, `zipcode_from`)
2512)
2513  ENGINE = InnoDB
2514  DEFAULT CHARSET = utf8mb4
2515  DEFAULT COLLATE utf8mb4_unicode_ci;
2516
2517CREATE TABLE `PREFIX_tax_rules_group` (
2518  `id_tax_rules_group` INT                 NOT NULL AUTO_INCREMENT PRIMARY KEY,
2519  `name`               VARCHAR(50)         NOT NULL,
2520  `active`             INT                 NOT NULL,
2521  `deleted`            TINYINT(1) UNSIGNED NOT NULL,
2522  `date_add`           DATETIME            NOT NULL,
2523  `date_upd`           DATETIME            NOT NULL
2524)
2525  ENGINE = InnoDB
2526  DEFAULT CHARSET = utf8mb4
2527  DEFAULT COLLATE utf8mb4_unicode_ci;
2528
2529CREATE TABLE `PREFIX_specific_price_priority` (
2530  `id_specific_price_priority` INT         NOT NULL AUTO_INCREMENT,
2531  `id_product`                 INT         NOT NULL,
2532  `priority`                   VARCHAR(80) NOT NULL,
2533  PRIMARY KEY (`id_specific_price_priority`, `id_product`),
2534  UNIQUE KEY `id_product` (`id_product`)
2535)
2536  ENGINE = InnoDB
2537  DEFAULT CHARSET = utf8mb4
2538  DEFAULT COLLATE utf8mb4_unicode_ci;
2539
2540CREATE TABLE `PREFIX_log` (
2541  `id_log`      INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
2542  `severity`    TINYINT(1)       NOT NULL,
2543  `error_code`  INT(11)                   DEFAULT NULL,
2544  `message`     TEXT             NOT NULL,
2545  `object_type` VARCHAR(32)               DEFAULT NULL,
2546  `object_id`   INT(11) UNSIGNED          DEFAULT NULL,
2547  `id_employee` INT(11) UNSIGNED          DEFAULT NULL,
2548  `date_add`    DATETIME         NOT NULL,
2549  `date_upd`    DATETIME         NOT NULL,
2550  PRIMARY KEY (`id_log`)
2551)
2552  ENGINE = InnoDB
2553  DEFAULT CHARSET = utf8mb4
2554  DEFAULT COLLATE utf8mb4_unicode_ci;
2555
2556CREATE TABLE `PREFIX_import_match` (
2557  `id_import_match` INT(10)     NOT NULL AUTO_INCREMENT,
2558  `name`            VARCHAR(32) NOT NULL,
2559  `match`           TEXT        NOT NULL,
2560  `skip`            INT(2)      NOT NULL,
2561  PRIMARY KEY (`id_import_match`)
2562)
2563  ENGINE = InnoDB
2564  DEFAULT CHARSET = utf8mb4
2565  DEFAULT COLLATE utf8mb4_unicode_ci;
2566
2567CREATE TABLE IF NOT EXISTS `PREFIX_shop_group` (
2568  `id_shop_group`  INT(11) UNSIGNED   NOT NULL AUTO_INCREMENT,
2569  `name`           VARCHAR(64)        NOT NULL,
2570  `share_customer` TINYINT(1)         NOT NULL,
2571  `share_order`    TINYINT(1)         NOT NULL,
2572  `share_stock`    TINYINT(1)         NOT NULL,
2573  `active`         TINYINT(1)         NOT NULL DEFAULT '1',
2574  `deleted`        TINYINT(1)         NOT NULL DEFAULT '0',
2575  PRIMARY KEY (`id_shop_group`),
2576  KEY `deleted` (`deleted`, `name`)
2577)
2578  ENGINE = InnoDB
2579  DEFAULT CHARSET = utf8mb4
2580  DEFAULT COLLATE utf8mb4_unicode_ci;
2581
2582CREATE TABLE IF NOT EXISTS `PREFIX_shop` (
2583  `id_shop`       INT(11) UNSIGNED   NOT NULL AUTO_INCREMENT,
2584  `id_shop_group` INT(11) UNSIGNED   NOT NULL,
2585  `name`          VARCHAR(64)        NOT NULL,
2586  `id_category`   INT(11) UNSIGNED   NOT NULL DEFAULT '1',
2587  `id_theme`      INT(1) UNSIGNED    NOT NULL,
2588  `active`        TINYINT(1)         NOT NULL DEFAULT '1',
2589  `deleted`       TINYINT(1)         NOT NULL DEFAULT '0',
2590  PRIMARY KEY (`id_shop`),
2591  KEY `id_shop_group` (`id_shop_group`, `deleted`),
2592  KEY `id_category` (`id_category`),
2593  KEY `id_theme` (`id_theme`)
2594)
2595  ENGINE = InnoDB
2596  DEFAULT CHARSET = utf8mb4
2597  DEFAULT COLLATE utf8mb4_unicode_ci;
2598
2599CREATE TABLE IF NOT EXISTS `PREFIX_shop_url` (
2600  `id_shop_url`  INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
2601  `id_shop`      INT(11) UNSIGNED NOT NULL,
2602  `domain`       VARCHAR(150)     NOT NULL,
2603  `domain_ssl`   VARCHAR(150)     NOT NULL,
2604  `physical_uri` VARCHAR(64)      NOT NULL,
2605  `virtual_uri`  VARCHAR(64)      NOT NULL,
2606  `main`         TINYINT(1)       NOT NULL,
2607  `active`       TINYINT(1)       NOT NULL,
2608  PRIMARY KEY (`id_shop_url`),
2609  KEY `id_shop` (`id_shop`, `main`),
2610  UNIQUE KEY `full_shop_url` (`domain`, `physical_uri`, `virtual_uri`),
2611  UNIQUE KEY `full_shop_url_ssl` (`domain_ssl`, `physical_uri`, `virtual_uri`)
2612)
2613  ENGINE = InnoDB
2614  DEFAULT CHARSET = utf8mb4
2615  DEFAULT COLLATE utf8mb4_unicode_ci;
2616
2617CREATE TABLE IF NOT EXISTS `PREFIX_theme` (
2618  `id_theme`             INT(11)          NOT NULL AUTO_INCREMENT,
2619  `name`                 VARCHAR(64)      NOT NULL,
2620  `directory`            VARCHAR(64)      NOT NULL,
2621  `responsive`           TINYINT(1)       NOT NULL DEFAULT '0',
2622  `default_left_column`  TINYINT(1)       NOT NULL DEFAULT '0',
2623  `default_right_column` TINYINT(1)       NOT NULL DEFAULT '0',
2624  `product_per_page`     INT(11) UNSIGNED NOT NULL,
2625  PRIMARY KEY (`id_theme`)
2626)
2627  ENGINE = InnoDB
2628  DEFAULT CHARSET = utf8mb4
2629  DEFAULT COLLATE utf8mb4_unicode_ci;
2630
2631CREATE TABLE IF NOT EXISTS `PREFIX_theme_meta` (
2632  `id_theme_meta` INT(11)          NOT NULL AUTO_INCREMENT,
2633  `id_theme`      INT(11)          NOT NULL,
2634  `id_meta`       INT(11) UNSIGNED NOT NULL,
2635  `left_column`   TINYINT(1)       NOT NULL DEFAULT '1',
2636  `right_column`  TINYINT(1)       NOT NULL DEFAULT '1',
2637  PRIMARY KEY (`id_theme_meta`),
2638  UNIQUE KEY `id_theme_2` (`id_theme`, `id_meta`),
2639  KEY `id_theme` (`id_theme`),
2640  KEY `id_meta` (`id_meta`)
2641)
2642  ENGINE = InnoDB
2643  DEFAULT CHARSET = utf8mb4
2644  AUTO_INCREMENT = 1;
2645
2646CREATE TABLE IF NOT EXISTS `PREFIX_theme_specific` (
2647  `id_theme`  INT(11) UNSIGNED NOT NULL,
2648  `id_shop`   INT(11) UNSIGNED NOT NULL,
2649  `entity`    INT(11) UNSIGNED NOT NULL,
2650  `id_object` INT(11) UNSIGNED NOT NULL,
2651  PRIMARY KEY (`id_theme`, `id_shop`, `entity`, `id_object`)
2652)
2653  ENGINE = InnoDB
2654  DEFAULT CHARSET = utf8mb4
2655  DEFAULT COLLATE utf8mb4_unicode_ci;
2656
2657CREATE TABLE `PREFIX_country_shop` (
2658  `id_country` INT(11) UNSIGNED NOT NULL,
2659  `id_shop`    INT(11) UNSIGNED NOT NULL,
2660  PRIMARY KEY (`id_country`, `id_shop`),
2661  KEY `id_shop` (`id_shop`)
2662)
2663  ENGINE = InnoDB
2664  DEFAULT CHARSET = utf8mb4
2665  DEFAULT COLLATE utf8mb4_unicode_ci;
2666
2667CREATE TABLE `PREFIX_carrier_shop` (
2668  `id_carrier` INT(11) UNSIGNED NOT NULL,
2669  `id_shop`    INT(11) UNSIGNED NOT NULL,
2670  PRIMARY KEY (`id_carrier`, `id_shop`),
2671  KEY `id_shop` (`id_shop`)
2672)
2673  ENGINE = InnoDB
2674  DEFAULT CHARSET = utf8mb4
2675  DEFAULT COLLATE utf8mb4_unicode_ci;
2676
2677CREATE TABLE `PREFIX_address_format` (
2678  `id_country` INT(11) UNSIGNED NOT NULL,
2679  `format`     VARCHAR(255)     NOT NULL DEFAULT '',
2680  PRIMARY KEY (`id_country`)
2681)
2682  ENGINE = InnoDB
2683  DEFAULT CHARSET = utf8mb4
2684  DEFAULT COLLATE utf8mb4_unicode_ci;
2685
2686CREATE TABLE `PREFIX_cms_shop` (
2687  `id_cms`  INT(11) UNSIGNED NOT NULL,
2688  `id_shop` INT(11) UNSIGNED NOT NULL,
2689  PRIMARY KEY (`id_cms`, `id_shop`),
2690  KEY `id_shop` (`id_shop`)
2691)
2692  ENGINE = InnoDB
2693  DEFAULT CHARSET = utf8mb4
2694  DEFAULT COLLATE utf8mb4_unicode_ci;
2695
2696CREATE TABLE `PREFIX_lang_shop` (
2697  `id_lang` INT(11) UNSIGNED NOT NULL,
2698  `id_shop` INT(11) UNSIGNED NOT NULL,
2699  PRIMARY KEY (`id_lang`, `id_shop`),
2700  KEY `id_shop` (`id_shop`)
2701)
2702  ENGINE = InnoDB
2703  DEFAULT CHARSET = utf8mb4
2704  DEFAULT COLLATE utf8mb4_unicode_ci;
2705
2706CREATE TABLE `PREFIX_currency_shop` (
2707  `id_currency`     INT(11) UNSIGNED NOT NULL,
2708  `id_shop`         INT(11) UNSIGNED NOT NULL,
2709  `conversion_rate` DECIMAL(13, 6)   NOT NULL,
2710  PRIMARY KEY (`id_currency`, `id_shop`),
2711  KEY `id_shop` (`id_shop`)
2712)
2713  ENGINE = InnoDB
2714  DEFAULT CHARSET = utf8mb4
2715  DEFAULT COLLATE utf8mb4_unicode_ci;
2716
2717CREATE TABLE `PREFIX_contact_shop` (
2718  `id_contact` INT(11) UNSIGNED NOT NULL,
2719  `id_shop`    INT(11) UNSIGNED NOT NULL,
2720  PRIMARY KEY (`id_contact`, `id_shop`),
2721  KEY `id_shop` (`id_shop`)
2722)
2723  ENGINE = InnoDB
2724  DEFAULT CHARSET = utf8mb4
2725  DEFAULT COLLATE utf8mb4_unicode_ci;
2726
2727CREATE TABLE `PREFIX_image_shop` (
2728  `id_product` INT(11) UNSIGNED    NOT NULL,
2729  `id_image`   INT(11) UNSIGNED    NOT NULL,
2730  `id_shop`    INT(11) UNSIGNED    NOT NULL,
2731  `cover`      TINYINT(1) UNSIGNED NULL DEFAULT NULL,
2732  PRIMARY KEY (`id_image`, `id_shop`),
2733  UNIQUE KEY `id_product` (`id_product`, `id_shop`, `cover`),
2734  KEY `id_shop` (`id_shop`)
2735)
2736  ENGINE = InnoDB
2737  DEFAULT CHARSET = utf8mb4
2738  DEFAULT COLLATE utf8mb4_unicode_ci;
2739
2740CREATE TABLE `PREFIX_attribute_shop` (
2741  `id_attribute` INT(11) UNSIGNED NOT NULL,
2742  `id_shop`      INT(11) UNSIGNED NOT NULL,
2743  PRIMARY KEY (`id_attribute`, `id_shop`),
2744  KEY `id_shop` (`id_shop`)
2745)
2746  ENGINE = InnoDB
2747  DEFAULT CHARSET = utf8mb4
2748  DEFAULT COLLATE utf8mb4_unicode_ci;
2749
2750CREATE TABLE `PREFIX_feature_shop` (
2751  `id_feature` INT(11) UNSIGNED NOT NULL,
2752  `id_shop`    INT(11) UNSIGNED NOT NULL,
2753  PRIMARY KEY (`id_feature`, `id_shop`),
2754  KEY `id_shop` (`id_shop`)
2755)
2756  ENGINE = InnoDB
2757  DEFAULT CHARSET = utf8mb4
2758  DEFAULT COLLATE utf8mb4_unicode_ci;
2759
2760CREATE TABLE `PREFIX_group_shop` (
2761  `id_group` INT(11) UNSIGNED NOT NULL,
2762  `id_shop`  INT(11) UNSIGNED NOT NULL,
2763  PRIMARY KEY (`id_group`, `id_shop`),
2764  KEY `id_shop` (`id_shop`)
2765)
2766  ENGINE = InnoDB
2767  DEFAULT CHARSET = utf8mb4
2768  DEFAULT COLLATE utf8mb4_unicode_ci;
2769
2770CREATE TABLE `PREFIX_attribute_group_shop` (
2771  `id_attribute_group` INT(11) UNSIGNED NOT NULL,
2772  `id_shop`            INT(11) UNSIGNED NOT NULL,
2773  PRIMARY KEY (`id_attribute_group`, `id_shop`),
2774  KEY `id_shop` (`id_shop`)
2775)
2776  ENGINE = InnoDB
2777  DEFAULT CHARSET = utf8mb4
2778  DEFAULT COLLATE utf8mb4_unicode_ci;
2779
2780CREATE TABLE `PREFIX_tax_rules_group_shop` (
2781  `id_tax_rules_group` INT(11) UNSIGNED NOT NULL,
2782  `id_shop`            INT(11) UNSIGNED NOT NULL,
2783  PRIMARY KEY (`id_tax_rules_group`, `id_shop`),
2784  KEY `id_shop` (`id_shop`)
2785)
2786  ENGINE = InnoDB
2787  DEFAULT CHARSET = utf8mb4
2788  DEFAULT COLLATE utf8mb4_unicode_ci;
2789
2790CREATE TABLE `PREFIX_zone_shop` (
2791  `id_zone` INT(11) UNSIGNED NOT NULL,
2792  `id_shop` INT(11) UNSIGNED NOT NULL,
2793  PRIMARY KEY (`id_zone`, `id_shop`),
2794  KEY `id_shop` (`id_shop`)
2795)
2796  ENGINE = InnoDB
2797  DEFAULT CHARSET = utf8mb4
2798  DEFAULT COLLATE utf8mb4_unicode_ci;
2799
2800CREATE TABLE `PREFIX_manufacturer_shop` (
2801  `id_manufacturer` INT(11) UNSIGNED NOT NULL,
2802  `id_shop`         INT(11) UNSIGNED NOT NULL,
2803  PRIMARY KEY (`id_manufacturer`, `id_shop`),
2804  KEY `id_shop` (`id_shop`)
2805)
2806  ENGINE = InnoDB
2807  DEFAULT CHARSET = utf8mb4
2808  DEFAULT COLLATE utf8mb4_unicode_ci;
2809
2810CREATE TABLE `PREFIX_supplier_shop` (
2811  `id_supplier` INT(11) UNSIGNED NOT NULL,
2812  `id_shop`     INT(11) UNSIGNED NOT NULL,
2813  PRIMARY KEY (`id_supplier`, `id_shop`),
2814  KEY `id_shop` (`id_shop`)
2815)
2816  ENGINE = InnoDB
2817  DEFAULT CHARSET = utf8mb4
2818  DEFAULT COLLATE utf8mb4_unicode_ci;
2819
2820CREATE TABLE `PREFIX_store_shop` (
2821  `id_store` INT(11) UNSIGNED NOT NULL,
2822  `id_shop`  INT(11) UNSIGNED NOT NULL,
2823  PRIMARY KEY (`id_store`, `id_shop`),
2824  KEY `id_shop` (`id_shop`)
2825)
2826  ENGINE = InnoDB
2827  DEFAULT CHARSET = utf8mb4
2828  DEFAULT COLLATE utf8mb4_unicode_ci;
2829
2830CREATE TABLE `PREFIX_module_shop` (
2831  `id_module`     INT(11) UNSIGNED NOT NULL,
2832  `id_shop`       INT(11) UNSIGNED NOT NULL,
2833  `enable_device` TINYINT(1)       NOT NULL DEFAULT '7',
2834  PRIMARY KEY (`id_module`, `id_shop`),
2835  KEY `id_shop` (`id_shop`)
2836)
2837  ENGINE = InnoDB
2838  DEFAULT CHARSET = utf8mb4
2839  DEFAULT COLLATE utf8mb4_unicode_ci;
2840
2841CREATE TABLE `PREFIX_webservice_account_shop` (
2842  `id_webservice_account` INT(11) UNSIGNED NOT NULL,
2843  `id_shop`               INT(11) UNSIGNED NOT NULL,
2844  PRIMARY KEY (`id_webservice_account`, `id_shop`),
2845  KEY `id_shop` (`id_shop`)
2846)
2847  ENGINE = InnoDB
2848  DEFAULT CHARSET = utf8mb4
2849  DEFAULT COLLATE utf8mb4_unicode_ci;
2850
2851CREATE TABLE `PREFIX_scene_shop` (
2852  `id_scene` INT(11) UNSIGNED NOT NULL,
2853  `id_shop`  INT(11) UNSIGNED NOT NULL,
2854  PRIMARY KEY (`id_scene`, `id_shop`),
2855  KEY `id_shop` (`id_shop`)
2856)
2857  ENGINE = InnoDB
2858  DEFAULT CHARSET = utf8mb4
2859  DEFAULT COLLATE utf8mb4_unicode_ci;
2860
2861CREATE TABLE `PREFIX_stock_mvt` (
2862  `id_stock_mvt`        BIGINT UNSIGNED  NOT NULL AUTO_INCREMENT,
2863  `id_stock`            INT(11) UNSIGNED NOT NULL,
2864  `id_order`            INT(11) UNSIGNED          DEFAULT NULL,
2865  `id_supply_order`     INT(11) UNSIGNED          DEFAULT NULL,
2866  `id_stock_mvt_reason` INT(11) UNSIGNED NOT NULL,
2867  `id_employee`         INT(11) UNSIGNED NOT NULL,
2868  `employee_lastname`   VARCHAR(32)               DEFAULT '',
2869  `employee_firstname`  VARCHAR(32)               DEFAULT '',
2870  `physical_quantity`   INT(11) UNSIGNED NOT NULL,
2871  `date_add`            DATETIME         NOT NULL,
2872  `sign`                TINYINT(1)       NOT NULL DEFAULT 1,
2873  `price_te`            DECIMAL(20, 6)            DEFAULT 0,
2874  `last_wa`             DECIMAL(20, 6)            DEFAULT 0,
2875  `current_wa`          DECIMAL(20, 6)            DEFAULT 0,
2876  `referer`             BIGINT UNSIGNED           DEFAULT NULL,
2877  PRIMARY KEY (`id_stock_mvt`),
2878  KEY `id_stock` (`id_stock`),
2879  KEY `id_stock_mvt_reason` (`id_stock_mvt_reason`)
2880)
2881  ENGINE = InnoDB
2882  DEFAULT CHARSET = utf8mb4
2883  DEFAULT COLLATE utf8mb4_unicode_ci;
2884
2885CREATE TABLE `PREFIX_stock_mvt_reason` (
2886  `id_stock_mvt_reason` INT(11) UNSIGNED    NOT NULL AUTO_INCREMENT,
2887  `sign`                TINYINT(1)          NOT NULL DEFAULT 1,
2888  `date_add`            DATETIME            NOT NULL,
2889  `date_upd`            DATETIME            NOT NULL,
2890  `deleted`             TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
2891  PRIMARY KEY (`id_stock_mvt_reason`)
2892)
2893  ENGINE = InnoDB
2894  DEFAULT CHARSET = utf8mb4
2895  DEFAULT COLLATE utf8mb4_unicode_ci;
2896
2897CREATE TABLE `PREFIX_stock_mvt_reason_lang` (
2898  `id_stock_mvt_reason` INT(11) UNSIGNED   NOT NULL,
2899  `id_lang`             INT(11) UNSIGNED   NOT NULL,
2900  `name`                VARCHAR(255)       NOT NULL,
2901  PRIMARY KEY (`id_stock_mvt_reason`, `id_lang`)
2902)
2903  ENGINE = InnoDB
2904  DEFAULT CHARSET = utf8mb4
2905  DEFAULT COLLATE utf8mb4_unicode_ci;
2906
2907CREATE TABLE `PREFIX_stock` (
2908  `id_stock`             INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
2909  `id_warehouse`         INT(11) UNSIGNED NOT NULL,
2910  `id_product`           INT(11) UNSIGNED NOT NULL,
2911  `id_product_attribute` INT(11) UNSIGNED NOT NULL,
2912  `reference`            VARCHAR(32)      NOT NULL,
2913  `ean13`                VARCHAR(13)               DEFAULT NULL,
2914  `upc`                  VARCHAR(12)               DEFAULT NULL,
2915  `physical_quantity`    INT(11) UNSIGNED NOT NULL,
2916  `usable_quantity`      INT(11) UNSIGNED NOT NULL,
2917  `price_te`             DECIMAL(20, 6)            DEFAULT 0,
2918  PRIMARY KEY (`id_stock`),
2919  KEY `id_warehouse` (`id_warehouse`),
2920  KEY `id_product` (`id_product`),
2921  KEY `id_product_attribute` (`id_product_attribute`)
2922)
2923  ENGINE = InnoDB
2924  DEFAULT CHARSET = utf8mb4
2925  DEFAULT COLLATE utf8mb4_unicode_ci;
2926
2927CREATE TABLE `PREFIX_warehouse` (
2928  `id_warehouse`    INT(11) UNSIGNED            NOT NULL AUTO_INCREMENT,
2929  `id_currency`     INT(11) UNSIGNED            NOT NULL,
2930  `id_address`      INT(11) UNSIGNED            NOT NULL,
2931  `id_employee`     INT(11) UNSIGNED            NOT NULL,
2932  `reference`       VARCHAR(32)                          DEFAULT NULL,
2933  `name`            VARCHAR(45)                 NOT NULL,
2934  `management_type` ENUM ('WA', 'FIFO', 'LIFO') NOT NULL DEFAULT 'WA',
2935  `deleted`         TINYINT(1) UNSIGNED         NOT NULL DEFAULT '0',
2936  PRIMARY KEY (`id_warehouse`)
2937)
2938  ENGINE = InnoDB
2939  DEFAULT CHARSET = utf8mb4
2940  DEFAULT COLLATE utf8mb4_unicode_ci;
2941
2942CREATE TABLE `PREFIX_warehouse_product_location` (
2943  `id_warehouse_product_location` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
2944  `id_product`                    INT(11) UNSIGNED NOT NULL,
2945  `id_product_attribute`          INT(11) UNSIGNED NOT NULL,
2946  `id_warehouse`                  INT(11) UNSIGNED NOT NULL,
2947  `location`                      VARCHAR(64)               DEFAULT NULL,
2948  PRIMARY KEY (`id_warehouse_product_location`),
2949  UNIQUE KEY `id_product` (`id_product`, `id_product_attribute`, `id_warehouse`)
2950)
2951  ENGINE = InnoDB
2952  DEFAULT CHARSET = utf8mb4
2953  DEFAULT COLLATE utf8mb4_unicode_ci;
2954
2955CREATE TABLE `PREFIX_warehouse_shop` (
2956  `id_shop`      INT(11) UNSIGNED NOT NULL,
2957  `id_warehouse` INT(11) UNSIGNED NOT NULL,
2958  PRIMARY KEY (`id_warehouse`, `id_shop`),
2959  KEY `id_warehouse` (`id_warehouse`),
2960  KEY `id_shop` (`id_shop`)
2961)
2962  ENGINE = InnoDB
2963  DEFAULT CHARSET = utf8mb4
2964  DEFAULT COLLATE utf8mb4_unicode_ci;
2965
2966CREATE TABLE `PREFIX_warehouse_carrier` (
2967  `id_carrier`   INT(11) UNSIGNED NOT NULL,
2968  `id_warehouse` INT(11) UNSIGNED NOT NULL,
2969  PRIMARY KEY (`id_warehouse`, `id_carrier`),
2970  KEY `id_warehouse` (`id_warehouse`),
2971  KEY `id_carrier` (`id_carrier`)
2972)
2973  ENGINE = InnoDB
2974  DEFAULT CHARSET = utf8mb4
2975  DEFAULT COLLATE utf8mb4_unicode_ci;
2976
2977CREATE TABLE `PREFIX_stock_available` (
2978  `id_stock_available`   INT(11) UNSIGNED    NOT NULL AUTO_INCREMENT,
2979  `id_product`           INT(11) UNSIGNED    NOT NULL,
2980  `id_product_attribute` INT(11) UNSIGNED    NOT NULL,
2981  `id_shop`              INT(11) UNSIGNED    NOT NULL,
2982  `id_shop_group`        INT(11) UNSIGNED    NOT NULL,
2983  `quantity`             INT(10)             NOT NULL DEFAULT '0',
2984  `depends_on_stock`     TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
2985  `out_of_stock`         TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
2986  PRIMARY KEY (`id_stock_available`),
2987  KEY `id_shop` (`id_shop`),
2988  KEY `id_shop_group` (`id_shop_group`),
2989  KEY `id_product` (`id_product`),
2990  KEY `id_product_attribute` (`id_product_attribute`),
2991  UNIQUE `product_sqlstock` (`id_product`, `id_product_attribute`, `id_shop`, `id_shop_group`)
2992)
2993  ENGINE = InnoDB
2994  DEFAULT CHARSET = utf8mb4
2995  DEFAULT COLLATE utf8mb4_unicode_ci;
2996
2997CREATE TABLE `PREFIX_supply_order` (
2998  `id_supply_order`        INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
2999  `id_supplier`            INT(11) UNSIGNED NOT NULL,
3000  `supplier_name`          VARCHAR(64)      NOT NULL,
3001  `id_lang`                INT(11) UNSIGNED NOT NULL,
3002  `id_warehouse`           INT(11) UNSIGNED NOT NULL,
3003  `id_supply_order_state`  INT(11) UNSIGNED NOT NULL,
3004  `id_currency`            INT(11) UNSIGNED NOT NULL,
3005  `id_ref_currency`        INT(11) UNSIGNED NOT NULL,
3006  `reference`              VARCHAR(64)      NOT NULL,
3007  `date_add`               DATETIME         NOT NULL,
3008  `date_upd`               DATETIME         NOT NULL,
3009  `date_delivery_expected` DATETIME                  DEFAULT NULL,
3010  `total_te`               DECIMAL(20, 6)            DEFAULT 0,
3011  `total_with_discount_te` DECIMAL(20, 6)            DEFAULT 0,
3012  `total_tax`              DECIMAL(20, 6)            DEFAULT 0,
3013  `total_ti`               DECIMAL(20, 6)            DEFAULT 0,
3014  `discount_rate`          DECIMAL(20, 6)            DEFAULT 0,
3015  `discount_value_te`      DECIMAL(20, 6)            DEFAULT 0,
3016  `is_template`            TINYINT(1)                DEFAULT '0',
3017  PRIMARY KEY (`id_supply_order`),
3018  KEY `id_supplier` (`id_supplier`),
3019  KEY `id_warehouse` (`id_warehouse`),
3020  KEY `reference` (`reference`)
3021)
3022  ENGINE = InnoDB
3023  DEFAULT CHARSET = utf8mb4
3024  DEFAULT COLLATE utf8mb4_unicode_ci;
3025
3026CREATE TABLE `PREFIX_supply_order_detail` (
3027  `id_supply_order_detail`        INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
3028  `id_supply_order`               INT(11) UNSIGNED NOT NULL,
3029  `id_currency`                   INT(11) UNSIGNED NOT NULL,
3030  `id_product`                    INT(11) UNSIGNED NOT NULL,
3031  `id_product_attribute`          INT(11) UNSIGNED NOT NULL,
3032  `reference`                     VARCHAR(32)      NOT NULL,
3033  `supplier_reference`            VARCHAR(32)      NOT NULL,
3034  `name`                          VARCHAR(128)     NOT NULL,
3035  `ean13`                         VARCHAR(13)               DEFAULT NULL,
3036  `upc`                           VARCHAR(12)               DEFAULT NULL,
3037  `exchange_rate`                 DECIMAL(20, 6)            DEFAULT 0,
3038  `unit_price_te`                 DECIMAL(20, 6)            DEFAULT 0,
3039  `quantity_expected`             INT(11) UNSIGNED NOT NULL,
3040  `quantity_received`             INT(11) UNSIGNED NOT NULL,
3041  `price_te`                      DECIMAL(20, 6)            DEFAULT 0,
3042  `discount_rate`                 DECIMAL(20, 6)            DEFAULT 0,
3043  `discount_value_te`             DECIMAL(20, 6)            DEFAULT 0,
3044  `price_with_discount_te`        DECIMAL(20, 6)            DEFAULT 0,
3045  `tax_rate`                      DECIMAL(20, 6)            DEFAULT 0,
3046  `tax_value`                     DECIMAL(20, 6)            DEFAULT 0,
3047  `price_ti`                      DECIMAL(20, 6)            DEFAULT 0,
3048  `tax_value_with_order_discount` DECIMAL(20, 6)            DEFAULT 0,
3049  `price_with_order_discount_te`  DECIMAL(20, 6)            DEFAULT 0,
3050  PRIMARY KEY (`id_supply_order_detail`),
3051  KEY `id_supply_order` (`id_supply_order`, `id_product`),
3052  KEY `id_product_attribute` (`id_product_attribute`),
3053  KEY `id_product_product_attribute` (`id_product`, `id_product_attribute`)
3054)
3055  ENGINE = InnoDB
3056  DEFAULT CHARSET = utf8mb4
3057  DEFAULT COLLATE utf8mb4_unicode_ci;
3058
3059CREATE TABLE `PREFIX_supply_order_history` (
3060  `id_supply_order_history` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
3061  `id_supply_order`         INT(11) UNSIGNED NOT NULL,
3062  `id_employee`             INT(11) UNSIGNED NOT NULL,
3063  `employee_lastname`       VARCHAR(32)               DEFAULT '',
3064  `employee_firstname`      VARCHAR(32)               DEFAULT '',
3065  `id_state`                INT(11) UNSIGNED NOT NULL,
3066  `date_add`                DATETIME         NOT NULL,
3067  PRIMARY KEY (`id_supply_order_history`),
3068  KEY `id_supply_order` (`id_supply_order`),
3069  KEY `id_employee` (`id_employee`),
3070  KEY `id_state` (`id_state`)
3071)
3072  ENGINE = InnoDB
3073  DEFAULT CHARSET = utf8mb4
3074  DEFAULT COLLATE utf8mb4_unicode_ci;
3075
3076CREATE TABLE `PREFIX_supply_order_state` (
3077  `id_supply_order_state` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
3078  `delivery_note`         TINYINT(1)       NOT NULL DEFAULT '0',
3079  `editable`              TINYINT(1)       NOT NULL DEFAULT '0',
3080  `receipt_state`         TINYINT(1)       NOT NULL DEFAULT '0',
3081  `pending_receipt`       TINYINT(1)       NOT NULL DEFAULT '0',
3082  `enclosed`              TINYINT(1)       NOT NULL DEFAULT '0',
3083  `color`                 VARCHAR(32)               DEFAULT NULL,
3084  PRIMARY KEY (`id_supply_order_state`)
3085)
3086  ENGINE = InnoDB
3087  DEFAULT CHARSET = utf8mb4
3088  DEFAULT COLLATE utf8mb4_unicode_ci;
3089
3090CREATE TABLE `PREFIX_supply_order_state_lang` (
3091  `id_supply_order_state` INT(11) UNSIGNED NOT NULL,
3092  `id_lang`               INT(11) UNSIGNED NOT NULL,
3093  `name`                  VARCHAR(128) DEFAULT NULL,
3094  PRIMARY KEY (`id_supply_order_state`, `id_lang`)
3095)
3096  ENGINE = InnoDB
3097  DEFAULT CHARSET = utf8mb4
3098  DEFAULT COLLATE utf8mb4_unicode_ci;
3099
3100CREATE TABLE `PREFIX_supply_order_receipt_history` (
3101  `id_supply_order_receipt_history` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
3102  `id_supply_order_detail`          INT(11) UNSIGNED NOT NULL,
3103  `id_employee`                     INT(11) UNSIGNED NOT NULL,
3104  `employee_lastname`               VARCHAR(32)               DEFAULT '',
3105  `employee_firstname`              VARCHAR(32)               DEFAULT '',
3106  `id_supply_order_state`           INT(11) UNSIGNED NOT NULL,
3107  `quantity`                        INT(11) UNSIGNED NOT NULL,
3108  `date_add`                        DATETIME         NOT NULL,
3109  PRIMARY KEY (`id_supply_order_receipt_history`),
3110  KEY `id_supply_order_detail` (`id_supply_order_detail`),
3111  KEY `id_supply_order_state` (`id_supply_order_state`)
3112)
3113  ENGINE = InnoDB
3114  DEFAULT CHARSET = utf8mb4
3115  DEFAULT COLLATE utf8mb4_unicode_ci;
3116
3117CREATE TABLE `PREFIX_product_supplier` (
3118  `id_product_supplier`        INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
3119  `id_product`                 INT(11) UNSIGNED NOT NULL,
3120  `id_product_attribute`       INT(11) UNSIGNED NOT NULL DEFAULT '0',
3121  `id_supplier`                INT(11) UNSIGNED NOT NULL,
3122  `product_supplier_reference` VARCHAR(32)               DEFAULT NULL,
3123  `product_supplier_price_te`  DECIMAL(20, 6)   NOT NULL DEFAULT 0,
3124  `id_currency`                INT(11) UNSIGNED NOT NULL,
3125  PRIMARY KEY (`id_product_supplier`),
3126  UNIQUE KEY `id_product` (`id_product`, `id_product_attribute`, `id_supplier`),
3127  KEY `id_supplier` (`id_supplier`, `id_product`)
3128)
3129  ENGINE = InnoDB
3130  DEFAULT CHARSET = utf8mb4
3131  DEFAULT COLLATE utf8mb4_unicode_ci;
3132
3133CREATE TABLE `PREFIX_order_carrier` (
3134  `id_order_carrier`       INT(11)          NOT NULL AUTO_INCREMENT,
3135  `id_order`               INT(11) UNSIGNED NOT NULL,
3136  `id_carrier`             INT(11) UNSIGNED NOT NULL,
3137  `id_order_invoice`       INT(11) UNSIGNED          DEFAULT NULL,
3138  `weight`                 DECIMAL(20, 6)            DEFAULT NULL,
3139  `shipping_cost_tax_excl` DECIMAL(20, 6)            DEFAULT NULL,
3140  `shipping_cost_tax_incl` DECIMAL(20, 6)            DEFAULT NULL,
3141  `tracking_number`        VARCHAR(64)               DEFAULT NULL,
3142  `date_add`               DATETIME         NOT NULL,
3143  PRIMARY KEY (`id_order_carrier`),
3144  KEY `id_order` (`id_order`),
3145  KEY `id_carrier` (`id_carrier`),
3146  KEY `id_order_invoice` (`id_order_invoice`)
3147)
3148  ENGINE = InnoDB
3149  DEFAULT CHARSET = utf8mb4
3150  DEFAULT COLLATE utf8mb4_unicode_ci;
3151
3152CREATE TABLE IF NOT EXISTS `PREFIX_specific_price_rule` (
3153  `id_specific_price_rule` INT(11) UNSIGNED              NOT NULL AUTO_INCREMENT,
3154  `name`                   VARCHAR(255)                  NOT NULL,
3155  `id_shop`                INT(11) UNSIGNED              NOT NULL DEFAULT '1',
3156  `id_currency`            INT(11) UNSIGNED              NOT NULL,
3157  `id_country`             INT(11) UNSIGNED              NOT NULL,
3158  `id_group`               INT(11) UNSIGNED              NOT NULL,
3159  `from_quantity`          MEDIUMINT(8) UNSIGNED         NOT NULL,
3160  `price`                  DECIMAL(20, 6),
3161  `reduction`              DECIMAL(20, 6)                NOT NULL,
3162  `reduction_tax`          TINYINT(1)                    NOT NULL DEFAULT 1,
3163  `reduction_type`         ENUM ('amount', 'percentage') NOT NULL,
3164  `from`                   DATETIME                      NOT NULL,
3165  `to`                     DATETIME                      NOT NULL,
3166  PRIMARY KEY (`id_specific_price_rule`),
3167  KEY `id_product` (`id_shop`, `id_currency`, `id_country`, `id_group`, `from_quantity`, `from`, `to`)
3168)
3169  ENGINE = InnoDB
3170  DEFAULT CHARSET = utf8mb4
3171  DEFAULT COLLATE utf8mb4_unicode_ci;
3172
3173CREATE TABLE `PREFIX_specific_price_rule_condition_group` (
3174  `id_specific_price_rule_condition_group` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
3175  `id_specific_price_rule`                 INT(11) UNSIGNED NOT NULL,
3176  PRIMARY KEY (`id_specific_price_rule_condition_group`, `id_specific_price_rule`)
3177)
3178  ENGINE = InnoDB
3179  DEFAULT CHARSET = utf8mb4
3180  DEFAULT COLLATE utf8mb4_unicode_ci;
3181
3182CREATE TABLE `PREFIX_specific_price_rule_condition` (
3183  `id_specific_price_rule_condition`       INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
3184  `id_specific_price_rule_condition_group` INT(11) UNSIGNED NOT NULL,
3185  `type`                                   VARCHAR(255)     NOT NULL,
3186  `value`                                  VARCHAR(255)     NOT NULL,
3187  PRIMARY KEY (`id_specific_price_rule_condition`),
3188  INDEX (`id_specific_price_rule_condition_group`)
3189)
3190  ENGINE = InnoDB
3191  DEFAULT CHARSET = utf8mb4
3192  DEFAULT COLLATE utf8mb4_unicode_ci;
3193
3194CREATE TABLE IF NOT EXISTS `PREFIX_risk` (
3195  `id_risk` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
3196  `percent` TINYINT(3)       NOT NULL,
3197  `color`   VARCHAR(32)      NULL,
3198  PRIMARY KEY (`id_risk`)
3199)
3200  ENGINE = InnoDB
3201  DEFAULT CHARSET = utf8mb4
3202  DEFAULT COLLATE utf8mb4_unicode_ci;
3203
3204CREATE TABLE IF NOT EXISTS `PREFIX_risk_lang` (
3205  `id_risk` INT(11) UNSIGNED NOT NULL,
3206  `id_lang` INT(11) UNSIGNED NOT NULL,
3207  `name`    VARCHAR(20)      NOT NULL,
3208  PRIMARY KEY (`id_risk`, `id_lang`),
3209  KEY `id_risk` (`id_risk`)
3210)
3211  ENGINE = InnoDB
3212  DEFAULT CHARSET = utf8mb4
3213  DEFAULT COLLATE utf8mb4_unicode_ci;
3214
3215CREATE TABLE `PREFIX_category_shop` (
3216  `id_category` INT(11) UNSIGNED NOT NULL,
3217  `id_shop`     INT(11) UNSIGNED NOT NULL,
3218  `position`    INT(11) UNSIGNED NOT NULL DEFAULT '0',
3219  PRIMARY KEY (`id_category`, `id_shop`)
3220)
3221  ENGINE = InnoDB
3222  DEFAULT CHARSET = utf8mb4
3223  DEFAULT COLLATE utf8mb4_unicode_ci;
3224
3225CREATE TABLE `PREFIX_module_preference` (
3226  `id_module_preference` INT(11)     NOT NULL AUTO_INCREMENT,
3227  `id_employee`          INT(11)     NOT NULL,
3228  `module`               VARCHAR(64) NOT NULL,
3229  `interest`             TINYINT(1)           DEFAULT NULL,
3230  `favorite`             TINYINT(1)           DEFAULT NULL,
3231  PRIMARY KEY (`id_module_preference`),
3232  UNIQUE KEY `employee_module` (`id_employee`, `module`)
3233)
3234  ENGINE = InnoDB
3235  DEFAULT CHARSET = utf8mb4
3236  DEFAULT COLLATE utf8mb4_unicode_ci;
3237
3238CREATE TABLE `PREFIX_tab_module_preference` (
3239  `id_tab_module_preference` INT(11)     NOT NULL AUTO_INCREMENT,
3240  `id_employee`              INT(11)     NOT NULL,
3241  `id_tab`                   INT(11)     NOT NULL,
3242  `module`                   VARCHAR(64) NOT NULL,
3243  PRIMARY KEY (`id_tab_module_preference`),
3244  UNIQUE KEY `employee_module` (`id_employee`, `id_tab`, `module`)
3245)
3246  ENGINE = InnoDB
3247  DEFAULT CHARSET = utf8mb4
3248  DEFAULT COLLATE utf8mb4_unicode_ci;
3249
3250CREATE TABLE `PREFIX_carrier_tax_rules_group_shop` (
3251  `id_carrier`         INT(11) UNSIGNED NOT NULL,
3252  `id_tax_rules_group` INT(11) UNSIGNED NOT NULL,
3253  `id_shop`            INT(11) UNSIGNED NOT NULL,
3254  PRIMARY KEY (`id_carrier`, `id_tax_rules_group`, `id_shop`)
3255)
3256  ENGINE = InnoDB
3257  DEFAULT CHARSET = utf8mb4
3258  DEFAULT COLLATE utf8mb4_unicode_ci;
3259
3260CREATE TABLE `PREFIX_order_invoice_payment` (
3261  `id_order_invoice` INT(11) UNSIGNED NOT NULL,
3262  `id_order_payment` INT(11) UNSIGNED NOT NULL,
3263  `id_order`         INT(11) UNSIGNED NOT NULL,
3264  PRIMARY KEY (`id_order_invoice`, `id_order_payment`),
3265  KEY `order_payment` (`id_order_payment`),
3266  KEY `id_order` (`id_order`)
3267)
3268  ENGINE = InnoDB
3269  DEFAULT CHARSET = utf8mb4
3270  DEFAULT COLLATE utf8mb4_unicode_ci;
3271
3272CREATE TABLE `PREFIX_smarty_cache` (
3273  `id_smarty_cache` CHAR(40)  NOT NULL,
3274  `name`            CHAR(40)  NOT NULL,
3275  `cache_id`        VARCHAR(64)        DEFAULT NULL,
3276  `modified`        TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
3277  `content`         LONGTEXT  NOT NULL,
3278  PRIMARY KEY (`id_smarty_cache`),
3279  KEY `name` (`name`),
3280  KEY `cache_id` (`cache_id`),
3281  KEY `modified` (`modified`)
3282)
3283  ENGINE = InnoDB
3284  DEFAULT CHARSET = utf8mb4
3285  DEFAULT COLLATE utf8mb4_unicode_ci;
3286
3287CREATE TABLE IF NOT EXISTS `PREFIX_order_slip_detail_tax` (
3288  `id_order_slip_detail` INT(11) UNSIGNED NOT NULL,
3289  `id_tax`               INT(11) UNSIGNED NOT NULL,
3290  `unit_amount`          DECIMAL(20, 6)   NOT NULL DEFAULT 0,
3291  `total_amount`         DECIMAL(20, 6)   NOT NULL DEFAULT 0,
3292  KEY (`id_order_slip_detail`),
3293  KEY `id_tax` (`id_tax`)
3294)
3295  ENGINE = InnoDB
3296  DEFAULT CHARSET = utf8mb4
3297  DEFAULT COLLATE utf8mb4_unicode_ci;
3298
3299CREATE TABLE IF NOT EXISTS `PREFIX_mail` (
3300  `id_mail`   INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
3301  `recipient` VARCHAR(126)     NOT NULL,
3302  `template`  VARCHAR(62)      NOT NULL,
3303  `subject`   VARCHAR(254)     NOT NULL,
3304  `id_lang`   INT(11) UNSIGNED NOT NULL,
3305  `date_add`  TIMESTAMP        NOT NULL DEFAULT CURRENT_TIMESTAMP,
3306  PRIMARY KEY (`id_mail`),
3307  KEY `recipient` (`recipient`(10))
3308)
3309  ENGINE = InnoDB
3310  DEFAULT CHARSET = utf8mb4
3311  DEFAULT COLLATE utf8mb4_unicode_ci;
3312
3313CREATE TABLE `PREFIX_smarty_lazy_cache` (
3314  `template_hash` VARCHAR(32)  NOT NULL DEFAULT '',
3315  `cache_id`      VARCHAR(64)  NOT NULL DEFAULT '',
3316  `compile_id`    VARCHAR(32)  NOT NULL DEFAULT '',
3317  `filepath`      VARCHAR(255) NOT NULL DEFAULT '',
3318  `last_update`   DATETIME     NOT NULL DEFAULT '1970-01-01 00:00:00',
3319  PRIMARY KEY (`template_hash`, `cache_id`, `compile_id`)
3320)
3321  ENGINE = InnoDB
3322  DEFAULT CHARSET = utf8mb4;
3323
3324CREATE TABLE `PREFIX_smarty_last_flush` (
3325  `type`       ENUM ('compile', 'template') NOT NULL DEFAULT 'compile',
3326  `last_flush` DATETIME NOT NULL DEFAULT '1970-01-01 00:00:00',
3327  PRIMARY KEY (`type`)
3328)
3329  ENGINE = InnoDB
3330  DEFAULT CHARSET = utf8mb4;
3331
3332CREATE TABLE `PREFIX_modules_perfs` (
3333  `id_modules_perfs` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
3334  `session`          INT(11) UNSIGNED NOT NULL,
3335  `module`           VARCHAR(64)      NOT NULL,
3336  `method`           VARCHAR(126)     NOT NULL,
3337  `time_start`       DOUBLE UNSIGNED  NOT NULL,
3338  `time_end`         DOUBLE UNSIGNED  NOT NULL,
3339  `memory_start`     INT UNSIGNED     NOT NULL,
3340  `memory_end`       INT UNSIGNED     NOT NULL,
3341  PRIMARY KEY (`id_modules_perfs`),
3342  KEY (`session`)
3343)
3344  ENGINE = InnoDB
3345  DEFAULT CHARSET = utf8mb4;
3346
3347CREATE TABLE IF NOT EXISTS `PREFIX_cms_role` (
3348  `id_cms_role` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
3349  `name`        VARCHAR(50)      NOT NULL,
3350  `id_cms`      INT(11) UNSIGNED NOT NULL,
3351  PRIMARY KEY (`id_cms_role`, `id_cms`),
3352  UNIQUE KEY `name` (`name`)
3353)
3354  ENGINE = InnoDB
3355  DEFAULT CHARSET = utf8mb4;
3356
3357CREATE TABLE IF NOT EXISTS `PREFIX_cms_role_lang` (
3358  `id_cms_role` INT(11) UNSIGNED NOT NULL,
3359  `id_lang`     INT(11) UNSIGNED NOT NULL,
3360  `id_shop`     INT(11) UNSIGNED NOT NULL,
3361  `name`        VARCHAR(128) DEFAULT NULL,
3362  PRIMARY KEY (`id_cms_role`, `id_lang`, id_shop)
3363)
3364  ENGINE = InnoDB
3365  DEFAULT CHARSET = utf8mb4;
3366
3367CREATE TABLE `PREFIX_redis_servers` (
3368  `id_redis_server` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
3369  `ip`              VARCHAR(46)      NOT NULL,
3370  `port`            INT(11) UNSIGNED NOT NULL,
3371  `auth`            TEXT,
3372  `db`              INT(11) UNSIGNED NOT NULL,
3373  PRIMARY KEY (`id_redis_server`)
3374)
3375  ENGINE = InnoDB
3376  DEFAULT CHARSET = utf8mb4
3377  COLLATE utf8mb4_unicode_ci;
3378
3379CREATE TABLE `PREFIX_currency_module`
3380(
3381  `id_currency` INT(11) UNSIGNED NOT NULL,
3382  `id_module`   INT(11) UNSIGNED,
3383  CONSTRAINT `uc_id_currency` UNIQUE (`id_currency`)
3384)
3385  ENGINE = ENGINE_TYPE
3386  DEFAULT CHARSET = utf8mb4
3387  COLLATE utf8mb4_unicode_ci;
3388
3389CREATE TABLE `PREFIX_page_cache` (
3390  `cache_hash`    CHAR(32)         NOT NULL,
3391  `id_currency`   INT(11) UNSIGNED,
3392  `id_language`   INT(11) UNSIGNED,
3393  `id_country`    INT(11) UNSIGNED,
3394  `id_shop`       INT(11) UNSIGNED,
3395  `entity_type`   VARCHAR(12)      NOT NULL,
3396  `id_entity`     INT(11) UNSIGNED,
3397  PRIMARY KEY (`cache_hash`),
3398  INDEX `cache_combo` (`cache_hash`, `id_currency`, `id_language`, `id_country`, `id_shop`)
3399)
3400  ENGINE = InnoDB
3401  DEFAULT CHARSET=utf8mb4
3402  COLLATE utf8mb4_unicode_ci;
3403