1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
CREATE TABLE IF NOT EXISTS `ObjectPropertiesTemplate` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `object` varchar(80) NOT NULL,
  `keyInt` int(11) unsigned NOT NULL,
  `keyExternalId` varchar(38) NOT NULL,
  `propertiesTemplateId` int(10) unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `keyExternalId` (`object`,`keyExternalId`),
  KEY `keyInt` (`keyInt`,`object`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=713 ;

CREATE TABLE IF NOT EXISTS `ProductsItems` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `productId` int(10) unsigned NOT NULL,
  `title` tinytext NOT NULL,
  `shortTitle` tinytext NOT NULL,
  `externalId` varchar(38) NOT NULL,
  `stockStatusId` int(11) NOT NULL DEFAULT '0',
  `shipping` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0 - none, 1 - yes, 2 - free',
  `productCode` varchar(20) NOT NULL COMMENT 'Артикул',
  `active` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `externalId` (`externalId`),
  KEY `productCode` (`productCode`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=359 ;

CREATE TABLE IF NOT EXISTS `Properties` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `title` tinytext NOT NULL,
  `propertyTypeId` int(10) unsigned NOT NULL DEFAULT '1',
  `defaultValueText` tinytext NOT NULL,
  `defaultValueInt` int(11) NOT NULL DEFAULT '0',
  `defaultValueFloat` float NOT NULL DEFAULT '0',
  `required` tinyint(1) NOT NULL DEFAULT '0',
  `multiple` tinyint(1) NOT NULL DEFAULT '0',
  `propertyTemplateId` int(10) unsigned NOT NULL,
  `externalId` varchar(38) NOT NULL DEFAULT '',
  `settings` text NOT NULL COMMENT 'settings for handler class',
  `description` tinytext NOT NULL,
  `display` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `object` (`propertyTemplateId`),
  KEY `externalId` (`externalId`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=15 ;

CREATE TABLE IF NOT EXISTS `PropertiesTemplates` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` tinytext NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;

CREATE TABLE IF NOT EXISTS `PropertiesValuesFloat` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `value` float NOT NULL DEFAULT '0',
  `objectId` int(10) unsigned NOT NULL,
  `propertyId` int(10) unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `objectId` (`objectId`,`propertyId`),
  KEY `value` (`value`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

CREATE TABLE IF NOT EXISTS `PropertiesValuesInt` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `value` int(11) NOT NULL DEFAULT '0',
  `objectId` int(10) unsigned NOT NULL,
  `propertyId` int(10) unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `objectId` (`objectId`,`propertyId`),
  KEY `value` (`value`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2155 ;

CREATE TABLE IF NOT EXISTS `PropertiesValuesText` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `value` text NOT NULL,
  `objectId` int(10) unsigned NOT NULL,
  `propertyId` int(10) unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `objectId` (`objectId`,`propertyId`),
  FULLTEXT KEY `value` (`value`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1181 ;