-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema.sql
More file actions
211 lines (178 loc) · 3.37 KB
/
schema.sql
File metadata and controls
211 lines (178 loc) · 3.37 KB
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
/*********************************\
* Dynamic *
\*********************************/
CREATE TABLE globals (
forum_username text,
forum_password text,
thread_id int,
last_turn_date text,
turn_number int,
success_point int
);
CREATE TABLE players (
id integer primary key,
name text COLLATE nocase,
phase int
);
CREATE TABLE offices (
player_id int,
region_id int,
level int,
quantity int
);
CREATE TABLE inventories (
player_id int,
item_id int,
quantity int
);
CREATE TABLE offers (
id integer primary key,
offerer int,
offeree int,
name text COLLATE nocase
);
CREATE TABLE offer_items (
offer_id int,
item_id int,
quantity int
);
CREATE TABLE loans (
id integer primary key,
offerer int,
offeree int,
coins int,
interest int,
due_by int,
accepted int,
name text COLLATE nocase
);
CREATE TABLE myth_offered (
player_id int,
item_id int,
god_id int,
quantity int
);
CREATE TABLE price_changes (
region_id int,
item_id int,
buy_change int,
sell_change int,
ends int
);
CREATE TABLE available_myth (
myth_power_id int,
purchased int
);
CREATE TABLE times_powers_purchased (
myth_power_id int,
times int
);
CREATE TABLE unused_myth (
myth_power_id int,
player_id int
);
CREATE TABLE queued_events (
id integer primary key,
event_id int,
message text,
starts int
);
CREATE TABLE price_change_event_regions (
queued_event_id int,
region_id int
);
CREATE TABLE give_items_event_players (
queued_event_id int,
player_id int
);
CREATE TABLE current_events (
message text,
ends int
);
CREATE TABLE turn_changes (
post_number int
);
CREATE TABLE posts (
post_number int,
author text,
html text COLLATE nocase
);
/*********************************\
* Static *
\*********************************/
CREATE TABLE params (
days_per_turn int,
starting_coins int,
myth_powers_start int,
base_office_price int,
office_multiplier int,
coins_id int,
roma_id int
);
CREATE TABLE regions (
id integer primary key,
name text COLLATE nocase
);
CREATE TABLE items (
id integer primary key,
capacity int,
name text COLLATE nocase,
buyable int
);
CREATE TABLE prices (
region_id int,
item_id int,
buy_price int,
sell_price int
);
CREATE TABLE gods (
id integer primary key,
name text COLLATE nocase
);
CREATE TABLE myth_powers (
id integer primary key,
god_id int,
name text COLLATE nocase,
description text,
event_id int,
delay int
);
CREATE TABLE myth_power_prices (
myth_power_id int,
item_id int,
quantity int
);
-- Event types:
-- give items (0);
-- price change (1);
CREATE TABLE "events" (
id integer primary key,
event_type int,
name text
);
CREATE TABLE price_change_events (
event_id int,
buy_change int,
sell_change int,
duration int
);
CREATE TABLE price_change_event_items (
event_id int,
item_id int
);
-- lower priority is given first
CREATE TABLE give_items_event_items (
event_id int,
item_id int,
quantity int,
priority int
);
CREATE TABLE upgrade_prices (
level int,
item_id int,
quantity int
);
CREATE TABLE office_levels (
level int,
capacity int
);