-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMySQL_extend_eanprod_xx_XX.sql
308 lines (268 loc) · 10.3 KB
/
MySQL_extend_eanprod_xx_XX.sql
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
########################################################
## MySQL_extend_eanprod_es_es.sql v2.4 ##
## (International) Japanese data tables ##
## This is a suplemental script that you can use to ##
## extend the database eanprod and add languages. ##
## we choose as a convention to use name_xx_xx ##
## table names are lowercase so it will work for all ##
## MySQL platforms the same. ##
########################################################
USE eanprod;
########################################################
## ##
## TABLES CREATED FROM THE EAN RELATIONAL DOWNLOADED ##
## FILES, but with the language code as: ##
## ar_SA,es_ES,fr_FR,it_IT,es_es,tr_TR,cs_CZ,es_MX, ##
## hr_HR,ko_KR,no_NO,ru_RU,uk_UA,da_DK,et_EE,hu_HU, ##
## lt_LT,nl_NL,sk_SK,vi_VN,de_DE,fi_FI,in_ID,lv_LV, ##
## pl_PL,sv_SE,zh_CN,el_GR,fr_CA,is_IS,ms_MY,pt_BR, ##
## th_TH,zh_TW ##
########################################################
## ActivePropertyList - structure is different for US version
DROP TABLE IF EXISTS activepropertylist_es_es;
CREATE TABLE activepropertylist_es_es
(
EANHotelID INT NOT NULL,
LanguageCode VARCHAR(5),
Name VARCHAR(70),
Location VARCHAR(80),
CheckInTime VARCHAR(10),
CheckOutTime VARCHAR(10),
TimeStamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (EANHotelID)
) CHARACTER SET utf8 COLLATE utf8_unicode_ci;
## table to correct search term for a region
## notice there are NO spaces between words
## AliasRegionList - structure is the same as US version
DROP TABLE IF EXISTS aliasregionlist_es_es;
CREATE TABLE aliasregionlist_es_es
(
RegionID INT NOT NULL,
LanguageCode VARCHAR(5),
AliasString VARCHAR(255),
TimeStamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
## PRIMARY KEY (RegionID, AliasString)
) CHARACTER SET utf8 COLLATE utf8_unicode_ci;
CREATE INDEX idx_aliasregionlist_es_es_regionid ON aliasregionlist_es_es(RegionID);
## AreaAttractionsList - structure is the same as US version
DROP TABLE IF EXISTS areaattractionslist_es_es;
CREATE TABLE areaattractionslist_es_es
(
EANHotelID INT NOT NULL,
LanguageCode VARCHAR(5),
AreaAttractions TEXT,
TimeStamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (EANHotelID)
) CHARACTER SET utf8 COLLATE utf8_unicode_ci;
## ActivePropertyList - structure is different for US version
DROP TABLE IF EXISTS attributelist_es_es;
CREATE TABLE attributelist_es_es
(
AttributeID INT NOT NULL,
LanguageCode VARCHAR(5),
AttributeDesc VARCHAR(255),
TimeStamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (AttributeID)
) CHARACTER SET utf8 COLLATE utf8_unicode_ci;
## CountryList - structure is different for US version
DROP TABLE IF EXISTS countrylist_es_es;
CREATE TABLE countrylist_es_es
(
CountryID INT NOT NULL,
LanguageCode VARCHAR(5),
## max of 191 so it will not break index max of 767 bytes (Unicode are 4x)
CountryName VARCHAR(191),
TimeStamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (CountryID)
) CHARACTER SET utf8 COLLATE utf8_unicode_ci;
## add indexes by country code & country name
CREATE INDEX idx_countrylist_es_es_countryname ON countrylist_es_es(CountryName);
## as the field ContryCode is not present, no index exist like the US version
## DinningDescriptionList - structure is the same as US version
DROP TABLE IF EXISTS diningdescriptionlist_es_es;
CREATE TABLE diningdescriptionlist_es_es
(
EANHotelID INT NOT NULL,
LanguageCode VARCHAR(5),
DiningDescription TEXT,
TimeStamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (EANHotelID)
) CHARACTER SET utf8 COLLATE utf8_unicode_ci;
## PolicyDescriptionList - structure is the same for US version
DROP TABLE IF EXISTS policydescriptionlist_es_es;
CREATE TABLE policydescriptionlist_es_es
(
EANHotelID INT NOT NULL,
LanguageCode VARCHAR(5),
PolicyDescription TEXT,
TimeStamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (EANHotelID)
) CHARACTER SET utf8 COLLATE utf8_unicode_ci;
## PropertyAttributeLink - structure is the same as US version
DROP TABLE IF EXISTS propertyattributelink_es_es;
CREATE TABLE propertyattributelink_es_es
(
EANHotelID INT NOT NULL,
AttributeID INT NOT NULL,
LanguageCode VARCHAR(5),
AppendTxt VARCHAR(191),
TimeStamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
## table so far do not present the same problem as GDSpropertyattributelink
PRIMARY KEY (EANHotelID, AttributeID)
) CHARACTER SET utf8 COLLATE utf8_unicode_ci;
## PropertyDescriptionList - structure is the same as US version
DROP TABLE IF EXISTS propertydescriptionlist_es_es;
CREATE TABLE propertydescriptionlist_es_es
(
EANHotelID INT NOT NULL,
LanguageCode VARCHAR(5),
PropertyDescription TEXT,
TimeStamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (EANHotelID)
) CHARACTER SET utf8 COLLATE utf8_unicode_ci;
## PropertyTypeList - structure is the same as US version
DROP TABLE IF EXISTS propertytypelist_es_es;
CREATE TABLE propertytypelist_es_es
(
PropertyCategory INT NOT NULL,
LanguageCode VARCHAR(5),
PropertyCategoryDesc VARCHAR(256),
TimeStamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (PropertyCategory)
) CHARACTER SET utf8 COLLATE utf8_unicode_ci;
## RecreationDescriptionList - structure is the same as US version
DROP TABLE IF EXISTS recreationdescriptionlist_es_es;
CREATE TABLE recreationdescriptionlist_es_es
(
EANHotelID INT NOT NULL,
LanguageCode VARCHAR(5),
RecreationDescription TEXT,
TimeStamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (EANHotelID)
) CHARACTER SET utf8 COLLATE utf8_unicode_ci;
## RegionList - structure is different for US version
## table is RegionList, while US is ParentRegionList
DROP TABLE IF EXISTS regionlist_es_es;
CREATE TABLE regionlist_es_es
(
RegionID INT NOT NULL,
LanguageCode VARCHAR(5),
RegionName VARCHAR(255),
RegionNameLong VARCHAR(510),
TimeStamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (RegionID)
) CHARACTER SET utf8 COLLATE utf8_unicode_ci;
## SpaDescriptionList - structure is the same as US version
DROP TABLE IF EXISTS spadescriptionlist_es_es;
CREATE TABLE spadescriptionlist_es_es
(
EANHotelID INT NOT NULL,
LanguageCode VARCHAR(5),
SpaDescription TEXT,
TimeStamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (EANHotelID)
) CHARACTER SET utf8 COLLATE utf8_unicode_ci;
## Multiple rooms per each hotel - so a compound primary key
## RoomTypeList - structure is different for US version
DROP TABLE IF EXISTS roomtypelist_es_es;
CREATE TABLE roomtypelist_es_es
(
EANHotelID INT NOT NULL,
RoomTypeID INT NOT NULL,
LanguageCode VARCHAR(5),
RoomTypeName VARCHAR(200),
RoomTypeDescription TEXT,
TimeStamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (EANHotelID, RoomTypeID)
) CHARACTER SET utf8 COLLATE utf8_unicode_ci;
## WhatToExpectList - structure is the same as US version
DROP TABLE IF EXISTS whattoexpectlist_es_es;
CREATE TABLE whattoexpectlist_es_es
(
EANHotelID INT NOT NULL,
LanguageCode VARCHAR(5),
WhatToExpect TEXT,
TimeStamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (EANHotelID)
) CHARACTER SET utf8 COLLATE utf8_unicode_ci;
## new files from minorrev=24
## PropertyLocationList (new)
DROP TABLE IF EXISTS propertylocationlist_es_es;
CREATE TABLE propertylocationlist_es_es
(
EANHotelID INT NOT NULL,
LanguageCode VARCHAR(5),
PropertyLocationDescription TEXT,
TimeStamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (EANHotelID)
) CHARACTER SET utf8 COLLATE utf8_unicode_ci;
## PropertyAmenitiesList (new)
DROP TABLE IF EXISTS propertyamenitieslist_es_es;
CREATE TABLE propertyamenitieslist_es_es
(
EANHotelID INT NOT NULL,
LanguageCode VARCHAR(5),
PropertyAmenitiesDescription TEXT,
TimeStamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (EANHotelID)
) CHARACTER SET utf8 COLLATE utf8_unicode_ci;
## PropertyRoomsList (new)
DROP TABLE IF EXISTS propertyroomslist_es_es;
CREATE TABLE propertyroomslist_es_es
(
EANHotelID INT NOT NULL,
LanguageCode VARCHAR(5),
PropertyRoomsDescription TEXT,
TimeStamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (EANHotelID)
) CHARACTER SET utf8 COLLATE utf8_unicode_ci;
## PropertyBusinessAmenitiesList (new)
DROP TABLE IF EXISTS propertybusinessamenitieslist_es_es;
CREATE TABLE propertybusinessamenitieslist_es_es
(
EANHotelID INT NOT NULL,
LanguageCode VARCHAR(5),
PropertyBusinessAmenitiesDescription TEXT,
TimeStamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (EANHotelID)
) CHARACTER SET utf8 COLLATE utf8_unicode_ci;
## PropertyNationalRatingList (new)
DROP TABLE IF EXISTS propertynationalratingslist_es_es;
CREATE TABLE propertynationalratingslist_es_es
(
EANHotelID INT NOT NULL,
LanguageCode VARCHAR(5),
PropertyNationalRatingsDescription TEXT,
TimeStamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (EANHotelID)
) CHARACTER SET utf8 COLLATE utf8_unicode_ci;
## PropertyFeesList (new)
DROP TABLE IF EXISTS propertyfeeslist_es_es;
CREATE TABLE propertyfeeslist_es_es
(
EANHotelID INT NOT NULL,
LanguageCode VARCHAR(5),
PropertyFeesDescription TEXT,
TimeStamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (EANHotelID)
) CHARACTER SET utf8 COLLATE utf8_unicode_ci;
## PropertyMandatoryFeesList (new)
DROP TABLE IF EXISTS propertymandatoryfeeslist_es_es;
CREATE TABLE propertymandatoryfeeslist_es_es
(
EANHotelID INT NOT NULL,
LanguageCode VARCHAR(5),
PropertyMandatoryFeesDescription TEXT,
TimeStamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (EANHotelID)
) CHARACTER SET utf8 COLLATE utf8_unicode_ci;
## PropertyRenovationList (new)
DROP TABLE IF EXISTS propertyrenovationslist_es_es;
CREATE TABLE propertyrenovationslist_es_es
(
EANHotelID INT NOT NULL,
LanguageCode VARCHAR(5),
PropertyRenovationsDescription TEXT,
TimeStamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (EANHotelID)
) CHARACTER SET utf8 COLLATE utf8_unicode_ci;