-
Notifications
You must be signed in to change notification settings - Fork 0
/
db.sql
331 lines (318 loc) · 10.7 KB
/
db.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
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
create table techs (
tech varchar(128) not null,
description text,
cost int,
primary key (tech)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci;
create table colors (
color varchar(128) not null,
primary key (color)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci;
create table tech_colors (
tech varchar(128) not null,
color varchar(128) not null,
primary key (tech, color),
foreign key (tech) references techs (tech),
foreign key (color) references colors (color)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci;
create table color_bonuses (
tech varchar(128) not null,
color varchar(128) not null,
bonus int not null,
primary key (tech, color),
foreign key (tech) references techs (tech),
foreign key (color) references colors (color)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci;
create table specific_bonuses (
tech varchar(128) not null,
other varchar(128) not null,
bonus int not null,
primary key (tech),
foreign key (tech) references techs (tech),
foreign key (other) references techs (tech)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci;
create table calamity_types (
type varchar(128) not null,
primary key (type)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci;
create table calamities (
calamity varchar(128) not null,
description text not null,
number int not null,
type varchar(128) not null,
primary key (calamity),
foreign key (type) references calamity_types (type)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci;
create table calamity_effects (
tech varchar(128) not null,
calamity varchar(128) not null,
description text,
type varchar(128) not null,
primary key (tech, calamity),
foreign key (calamity) references calamities (calamity),
foreign key (tech) references techs (tech)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci;
insert into colors (color) values
('red'), ('green'), ('orange'), ('blue'), ('yellow');
insert into calamity_types (type) values
('minor'), ('major'), ('non-tradable');
insert into techs (cost, tech) values
( 60, 'Masonry' ),
( 50, 'Cloth Making' ),
( 60, 'Pottery' ),
( 50, 'Sculpture' ),
( 60, 'Empiricism' ),
( 90, 'Metalworking' ),
( 80, 'Astronomy' ),
( 60, 'Mythology' ),
(120, 'Agriculture' ),
(110, 'Literacy' ),
(140, 'Medicine' ),
( 50, 'Mysticism' ),
( 60, 'Written record' ),
( 50, 'Urbanism' ),
( 60, 'Monarchy' ),
( 80, 'Drama and poetry' ),
( 80, 'Music' ),
( 90, 'Coinage' ),
( 80, 'Deism' ),
( 80, 'Theocracy' ),
(140, 'Architecture' ),
(130, 'Rhetoric' ),
(160, 'Engeneering' ),
(160, 'Cartography' ),
(180, 'Monument' ),
(180, 'Trade routes' ),
(160, 'Naval warfare' ),
(180, 'Calendar' ),
(150, 'Fundamentalism' ),
(160, 'Enlightenment' ),
(160, 'Universial doctrine'),
(180, 'Diplomacy' ),
(170, 'Law' ),
(170, 'Military' ),
(220, 'Roadbuilding' ),
(230, 'Mining' ),
(220, 'Library' ),
(240, 'Mathematics' ),
(220, 'Democracy' ),
(230, 'Politics' ),
(240, 'Philosophy' ),
(260, 'Trade empire' ),
(230, 'Public Works' ),
(240, 'Monotheism' ),
(280, 'Wonder of the world'),
(270, 'Anatomy' ),
(250, 'Theology' ),
(260, 'Advanced Military' ),
(260, 'Provincial Empire' ),
(280, 'Cultural Ascendancy'),
(270, 'Diaspora' );
insert into tech_colors (color, tech) values
('orange', 'Masonry' ),
('orange', 'Cloth Making' ),
('orange', 'Pottery' ),
('blue', 'Sculpture' ),
('green', 'Empiricism' ),
('orange', 'Metalworking' ),
('green', 'Astronomy' ),
('red', 'Mythology' ),
('orange', 'Agriculture' ),
('blue', 'Literacy' ),
('red', 'Literacy' ),
('green', 'Medicine' ),
('blue', 'Mysticism' ),
('yellow', 'Mysticism' ),
('green', 'Written record' ),
('red', 'Written record' ),
('red', 'Urbanism' ),
('red', 'Monarchy' ),
('blue', 'Drama and poetry' ),
('blue', 'Music' ),
('green', 'Coinage' ),
('red', 'Deism' ),
('yellow', 'Theocracy' ),
('red', 'Theocracy' ),
('blue', 'Architecture' ),
('blue', 'Rhetoric' ),
('green', 'Engeneering' ),
('orange', 'Engeneering' ),
('green', 'Cartography' ),
('yellow', 'Monument' ),
('orange', 'Monument' ),
('orange', 'Trade routes' ),
('red', 'Naval warfare' ),
('green', 'Calendar' ),
('red', 'Fundamentalism' ),
('red', 'Enlightenment' ),
('red', 'Universial doctrine'),
('blue', 'Diplomacy' ),
('red', 'Law' ),
('red', 'Military' ),
('orange', 'Roadbuilding' ),
('orange', 'Mining' ),
('green', 'Library' ),
('green', 'Mathematics' ),
('blue', 'Mathematics' ),
('red', 'Democracy' ),
('blue', 'Politics' ),
('green', 'Philosophy' ),
('yellow', 'Philosophy' ),
('orange', 'Trade empire' ),
('red', 'Public Works' ),
('red', 'Monotheism' ),
('blue', 'Wonder of the world'),
('orange', 'Wonder of the world'),
('green', 'Anatomy' ),
('red', 'Theology' ),
('red', 'Advanced Military' ),
('red', 'Provincial Empire' ),
('blue', 'Cultural Ascendancy'),
('red', 'Diaspora' );
insert into color_bonuses (tech, color, bonus) values
('Masonry', 'green', 5),
('Masonry', 'orange', 10),
('Cloth Making', 'blue', 5),
('Cloth Making', 'orange', 10),
('Pottery', 'blue', 5),
('Pottery', 'orange', 10),
('Sculpture', 'blue', 10),
('Sculpture', 'red', 5),
('Empiricism', 'green', 10),
('Empiricism', 'blue', 5),
('Empiricism', 'yellow', 5),
('Empiricism', 'red', 5),
('Empiricism', 'orange', 5),
('Metalworking', 'green', 5),
('Metalworking', 'orange', 10),
('Astronomy', 'green', 10),
('Astronomy', 'yellow', 5),
('Mythology', 'blue', 5),
('Mythology', 'yellow', 10),
('Agriculture', 'green', 5),
('Agriculture', 'orange', 10),
('Literacy', 'green', 5),
('Literacy', 'blue', 10),
('Literacy', 'yellow', 5),
('Literacy', 'red', 10),
('Literacy', 'orange', 5),
('Medicine', 'green', 10),
('Medicine', 'orange', 5),
('Mysticism', 'blue', 5),
('Mysticism', 'yellow', 5),
('Written record', 'green', 5),
('Written record', 'red', 5),
('Urbanism', 'green', 5),
('Urbanism', 'red', 10),
('Monarchy', 'yellow', 5),
('Monarchy', 'red', 10),
('Drama and poetry', 'blue', 10),
('Drama and poetry', 'yellow', 5),
('Music', 'blue', 10),
('Music', 'yellow', 5),
('Coinage', 'green', 10),
('Coinage', 'red', 5),
('Deism', 'yellow', 10),
('Deism', 'orange', 5),
('Theocracy', 'yellow', 5),
('Theocracy', 'red', 5),
('Architecture', 'green', 5),
('Architecture', 'blue', 10),
('Rhetoric', 'blue', 10),
('Rhetoric', 'red', 5),
('Engeneering', 'green', 5),
('Engeneering', 'orange', 5),
('Cartography', 'green', 10),
('Cartography', 'blue', 5),
('Monument', 'yellow', 5),
('Monument', 'orange', 5),
('Trade routes', 'yellow', 5),
('Trade routes', 'orange', 10),
('Naval warfare', 'red', 10),
('Naval warfare', 'orange', 5),
('Calendar', 'green', 10),
('Calendar', 'red', 5),
('Fundamentalism', 'blue', 5),
('Fundamentalism', 'yellow', 10),
('Enlightenment', 'yellow', 10),
('Enlightenment', 'orange', 5),
('Universial doctrine', 'yellow', 10),
('Universial doctrine', 'red', 5),
('Diplomacy', 'blue', 10),
('Diplomacy', 'red', 5),
('Law', 'yellow', 5),
('Law', 'red', 10),
('Military', 'red', 10),
('Military', 'orange', 5),
('Roadbuilding', 'green', 5),
('Roadbuilding', 'orange', 10),
('Mining', 'green', 5),
('Mining', 'orange', 10),
('Library', 'green', 10),
('Library', 'blue', 5),
('Mathematics', 'green', 10),
('Mathematics', 'blue', 10),
('Mathematics', 'yellow', 10),
('Mathematics', 'red', 10),
('Mathematics', 'orange', 10),
('Democracy', 'blue', 5),
('Democracy', 'red', 10),
('Politics', 'blue', 10),
('Politics', 'yellow', 5),
('Philosophy', 'green', 5),
('Philosophy', 'yellow', 5),
('Trade empire', 'red', 5),
('Trade empire', 'orange', 10),
('Public Works', 'red', 10),
('Public Works', 'orange', 5),
('Monotheism', 'yellow', 10),
('Monotheism', 'red', 5),
('Wonder of the world', 'blue', 5),
('Wonder of the world', 'orange', 5),
('Anatomy', 'green', 10),
('Anatomy', 'orange', 5),
('Theology', 'green', 5),
('Theology', 'yellow', 10),
('Advanced Military', 'green', 5),
('Advanced Military', 'red', 10),
('Provincial Empire', 'yellow', 5),
('Provincial Empire', 'red', 10),
('Cultural Ascendancy', 'blue', 10),
('Cultural Ascendancy', 'yellow', 5),
('Diaspora', 'blue', 5),
('Diaspora', 'yellow', 10);
insert into specific_bonuses (tech, bonus, other) values
('Masonry' , 10, 'Engeneering'),
('Cloth Making' , 10, 'Naval warfare'),
('Pottery' , 10, 'Agriculture'),
('Sculpture' , 10, 'Architecture'),
('Empiricism' , 10, 'Medicine'),
('Metalworking' , 10, 'Military'),
('Astronomy' , 10, 'Calendar'),
('Mythology' , 10, 'Literacy'),
('Agriculture' , 20, 'Democracy'),
('Literacy' , 20, 'Mathematics'),
('Medicine' , 20, 'Anatomy'),
('Mysticism' , 10, 'Monument'),
('Written record' , 10, 'Cartography'),
('Urbanism' , 10, 'Diplomacy'),
('Monarchy' , 10, 'Law'),
('Drama and poetry' , 10, 'Rhetoric'),
('Music' , 10, 'Enlightenment'),
('Coinage' , 10, 'Trade routes'),
('Deism' , 10, 'Fundamentalism'),
('Theocracy' , 10, 'Universial doctrine'),
('Architecture' , 20, 'Mining'),
('Rhetoric' , 20, 'Politics'),
('Engeneering' , 20, 'Roadbuilding'),
('Cartography' , 20, 'Library'),
('Monument' , 20, 'Wonder of the world'),
('Trade routes' , 20, 'Trade empire'),
('Naval warfare' , 20, 'Diaspora'),
('Calendar' , 20, 'Public Works'),
('Fundamentalism' , 20, 'Monotheism'),
('Enlightenment' , 20, 'Philosophy'),
('Universial doctrine', 20, 'Theology'),
('Diplomacy' , 20, 'Provincial Empire'),
('Law' , 20, 'Cultural Ascendancy'),
('Military' , 20, 'Advanced Military');